-
Notifications
You must be signed in to change notification settings - Fork 76
160 lines (145 loc) · 5.92 KB
/
Copy pathblockifier_ci.yml
File metadata and controls
160 lines (145 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Blockifier-CI
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
paths:
- ".github/actions/bootstrap/action.yml"
- ".github/workflows/blockifier_ci.yml"
- ".github/workflows/upload_artifacts_workflow.yml"
- "Cargo.lock"
- "Cargo.toml"
- "crates/blockifier/**"
- "crates/blockifier_test_utils/**"
- "crates/native_blockifier/**"
- "crates/apollo_sierra_multicompile/build.rs"
- "scripts/build_native_blockifier.sh"
- "scripts/dependencies.sh"
- "scripts/install_build_tools.sh"
- "scripts/sequencer-ci.Dockerfile"
env:
RUSTFLAGS: "-D warnings"
TRANSFERS_BENCHMARK_CAIRO_NATIVE_TIME_LIMIT_NS: "200000000"
TRANSFERS_BENCHMARK_VM_TIME_LIMIT_NS: "1000000000"
# On PR events, cancel existing CI runs on this same PR for this workflow.
# Also, create different concurrency groups for different pushed commits, on push events.
concurrency:
group: >
${{ github.workflow }}-
${{ github.ref }}-
${{ github.event_name == 'pull_request' && 'PR' || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# https://graphite.com/docs/stacking-and-ci
optimize_ci:
runs-on: ubuntu-24.04
timeout-minutes: 60
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- name: Optimize CI
id: check_skip
uses: withgraphite/graphite-ci-action@v0.0.9
with:
graphite_token: ${{ secrets.GRAPHITE_CI_OPTIMIZER_TOKEN }}
test-without-features:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# No features - build blockifier without features activated by dependencies in the workspace.
- run: cargo test -p blockifier
- run: cargo build -p blockifier
test-with-transaction-serde-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# transaction_serde is not activated by any workspace crate; test the build.
- run: cargo test -p blockifier --features transaction_serde
- run: cargo build -p blockifier --features transaction_serde
test-with-cairo-native-feature:
runs-on: namespace-profile-large-ubuntu-24-04-amd64
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# cairo_native is not activated by any workspace crate; test the build.
- run: cargo build -p blockifier --features cairo_native
- run: cargo test -p blockifier --features cairo_native
test-with-tracing-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# tracing is not activated by any workspace crate; test the build.
- run: cargo build -p blockifier --features tracing
- run: cargo test -p blockifier --features tracing
benchmarking:
runs-on: namespace-profile-xlarge-ubuntu-24-04-amd64
needs: optimize_ci
if: github.event_name == 'pull_request' && needs.optimize_ci.outputs.skip == 'false'
timeout-minutes: 60
steps:
# TODO(AndrewL): Remove this after a while in CI (March 4 2026)
- name: Print PR and base SHAs
run: |
echo "github.sha (merge commit): ${{ github.sha }}"
echo "PR HEAD SHA: ${{ github.event.pull_request.head.sha }}"
echo "PR base SHA: ${{ github.event.pull_request.base.sha }}"
echo "PR base_ref: ${{ github.base_ref }}"
# Checkout the base branch to benchmark the old code.
# Use base.sha (a concrete commit hash from the webhook payload) instead of
# base_ref (a branch name) to avoid failures when Graphite's temporary refs
# are deleted before the runner reaches this step.
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Benchmark the base branch code.
- name: Benchmark (Base Branch)
run: cargo run -p bench_tools -- run --package blockifier --out /tmp/base_results
# Checkout the PR branch into a unique subdirectory to avoid overwriting
# the base branch's composite action files at the workspace root, and to
# avoid colliding with any repo folder (e.g. one named "pr").
- uses: actions/checkout@v6
with:
path: pr-${{ github.run_id }}
# Copy base branch Criterion baseline into PR dir so run-and-compare finds it.
- run: |
mkdir -p pr-${{ github.run_id }}/target
cp -r target/criterion pr-${{ github.run_id }}/target/
# Benchmark the current branch and compare to the previous run.
- name: Benchmark (Feature Branch)
working-directory: pr-${{ github.run_id }}
run: |
cargo run -p bench_tools -- run-and-compare \
--package blockifier \
--out /tmp/new_results \
--regression-limit 8.0 \
--set-absolute-time-ns-limit transfers_benchmark_cairo_native ${TRANSFERS_BENCHMARK_CAIRO_NATIVE_TIME_LIMIT_NS} \
--set-absolute-time-ns-limit transfers_benchmark_vm ${TRANSFERS_BENCHMARK_VM_TIME_LIMIT_NS}