-
Notifications
You must be signed in to change notification settings - Fork 1
288 lines (242 loc) · 8.69 KB
/
Copy pathpr_main.yaml
File metadata and controls
288 lines (242 loc) · 8.69 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
name: Integration Tests
on:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]
paths-ignore: ["spec/**"]
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
# "Lint" is a required check, don't change the name
name: Lint
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.actor != 'github-merge-queue[bot]'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "lambda-vm-lint"
cache-all-crates: "true"
- name: Run lint checks
run: make lint
test-executor:
name: Executor tests
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.actor != 'github-merge-queue[bot]'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "lambda-vm-test"
cache-all-crates: "true"
- name: Cache compiled ASM ELF artifacts
id: cache-asm-elfs
uses: actions/cache@v4
with:
path: executor/program_artifacts/asm
key: asm-elf-artifacts-${{ hashFiles('executor/programs/asm/**') }}
- name: Compile ASM programs to ELF
if: steps.cache-asm-elfs.outputs.cache-hit != 'true'
run: |
make compile-programs-asm
- name: Cache compiled Rust ELF artifacts and build cache
id: cache-rust-elfs
uses: actions/cache@v4
with:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
restore-keys: |
rust-elf-artifacts-
- name: Compile Rust programs to ELF
if: steps.cache-rust-elfs.outputs.cache-hit != 'true'
run: |
make compile-programs-rust
- name: Run asm tests (no compile)
run: |
cargo test --release -p executor --test asm
- name: Run rust tests (no compile)
run: |
cargo test --release -p executor --test rust
- name: Run flamegraph tests
run: |
cargo test --release -p executor --test flamegraph
- name: Run ignored executor tests
run: |
make prepare-test-data
cargo test --release -p executor test_ethrex -- --ignored
cargo test --release -p executor test_ckzg -- --ignored
# "Test" is a required check — keep this name to avoid branch protection changes.
# This gate job passes only when executor tests AND all prover shards succeed.
test:
name: Test
if: always()
needs: [test-executor, test-prover]
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
executor="${{ needs.test-executor.result }}"
prover="${{ needs.test-prover.result }}"
echo "test-executor: $executor"
echo "test-prover: $prover"
# Allow "success" or "skipped" (skipped on merge queue pushes)
if [[ "$executor" != "success" && "$executor" != "skipped" ]]; then
exit 1
fi
if [[ "$prover" != "success" && "$prover" != "skipped" ]]; then
exit 1
fi
build-prover-tests:
name: Build prover tests
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.actor != 'github-merge-queue[bot]'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "lambda-vm-prover-test"
cache-all-crates: "true"
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Build and archive prover + crypto tests
run: |
cargo nextest archive --release \
-p lambda-vm-prover -p stark -p crypto \
--archive-file prover-tests.tar.zst
- name: Upload test archive
uses: actions/upload-artifact@v4
with:
name: prover-tests
path: prover-tests.tar.zst
retention-days: 1
test-prover:
name: Prover tests (${{ matrix.partition }}/4)
needs: build-prover-tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache compiled ASM ELF artifacts
id: cache-asm-elfs
uses: actions/cache@v4
with:
path: executor/program_artifacts/asm
key: asm-elf-artifacts-${{ hashFiles('executor/programs/asm/**') }}
- name: Install clang and lld
if: steps.cache-asm-elfs.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y clang lld
- name: Compile ASM programs to ELF
if: steps.cache-asm-elfs.outputs.cache-hit != 'true'
run: |
make compile-programs-asm
- name: Cache compiled Rust ELF artifacts and build cache
id: cache-rust-elfs
uses: actions/cache@v4
with:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
restore-keys: |
rust-elf-artifacts-
- name: Setup Rust Environment
if: steps.cache-rust-elfs.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-rust
- name: Compile Rust programs to ELF
if: steps.cache-rust-elfs.outputs.cache-hit != 'true'
run: |
make compile-programs-rust
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Download test archive
uses: actions/download-artifact@v4
with:
name: prover-tests
- name: Run prover tests (shard ${{ matrix.partition }}/4)
run: |
cargo nextest run \
--archive-file prover-tests.tar.zst \
--partition hash:${{ matrix.partition }}/4 \
--test-threads=1
test-prover-comprehensive:
name: Prover comprehensive tests
needs: build-prover-tests
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache compiled ASM ELF artifacts
id: cache-asm-elfs
uses: actions/cache@v4
with:
path: executor/program_artifacts/asm
key: asm-elf-artifacts-${{ hashFiles('executor/programs/asm/**') }}
- name: Install clang and lld
if: steps.cache-asm-elfs.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y clang lld
- name: Compile ASM programs to ELF
if: steps.cache-asm-elfs.outputs.cache-hit != 'true'
run: |
make compile-programs-asm
- name: Cache compiled Rust ELF artifacts and build cache
id: cache-rust-elfs
uses: actions/cache@v4
with:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
restore-keys: |
rust-elf-artifacts-
- name: Setup Rust Environment
if: steps.cache-rust-elfs.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-rust
- name: Compile Rust programs to ELF
if: steps.cache-rust-elfs.outputs.cache-hit != 'true'
run: |
make compile-programs-rust
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Download test archive
uses: actions/download-artifact@v4
with:
name: prover-tests
- name: Run comprehensive prover tests
run: |
cargo nextest run \
--archive-file prover-tests.tar.zst \
--test-threads=1 \
-E 'test(test_prove_elfs_all_instructions_64_full)' \
--run-ignored ignored-only