forked from privacy-scaling-explorations/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 387
293 lines (271 loc) · 9.28 KB
/
ci.yml
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
289
290
291
292
name: CI checks
on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
# Ignore when target branch is `main` and source branch is develop.
# It could avoid running twice. Since develop is set as `push` below.
branches-ignore:
- main
push:
branches:
- develop
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git
RUST_MIN_STACK: 16777216
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/README.md"]'
runner:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
uses: ./.github/workflows/select-runner.yml
test-default:
name: Test Default
if: false
needs: [runner]
runs-on: ${{ matrix.os }}
concurrency: ${{ needs.runner.outputs.concurrency-group1 }}
strategy:
matrix:
os: ${{ fromJSON(needs.runner.outputs.runner-matrix1) }}
steps:
- uses: actions/checkout@v4
- name: set HOME env
run: |
echo "HOME=/home/CI" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-25
- name: Setup golang
uses: actions/setup-go@v3
with:
cache: false
go-version: ~1.22
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://github.com/actions/cache/issues/810
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: Run light tests # light tests are run in parallel
run: cargo test --verbose --release --all --exclude prover --exclude integration-tests --exclude circuit-benchmarks -- -Zunstable-options --report-time
- name: Run heavy tests # heavy tests are run serially to avoid OOM
if: false
run: cargo test --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --test-threads 1
test-scroll:
name: Test Scroll
needs: [runner]
runs-on: ${{ matrix.os }}
concurrency: ${{ needs.runner.outputs.concurrency-group2 }}
strategy:
matrix:
os: ${{ fromJSON(needs.runner.outputs.runner-matrix2) }}
steps:
- uses: actions/checkout@v4
- name: set HOME env
run: |
echo "HOME=/home/CI" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-25
- name: Setup golang
uses: actions/setup-go@v3
with:
cache: false
go-version: ~1.22
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://github.com/actions/cache/issues/810
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: Run light tests # light tests are run in parallel
run: cargo test --verbose --release --all --features scroll --exclude integration-tests --exclude circuit-benchmarks --exclude testool -- -Zunstable-options --report-time
- name: Run heavy tests
run: cargo test --verbose --release --features scroll --all --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --skip max_tx -Zunstable-options --report-time
- name: Run parallel assignment tests(bytecode)
if: false
run: cargo test --release --package zkevm-circuits --lib bytecode_circuit::test --features scroll,parallel_syn -- --nocapture
- name: Run parallel assignment tests(state)
if: false
run: cargo test --release --package zkevm-circuits --lib state_circuit::test --features scroll,parallel_syn -- --nocapture
build:
needs: [skip_check]
if: |
false &&
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-unknown-unknown
- wasm32-wasi
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-25
- name: Add target
run: rustup target add ${{ matrix.target }}
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://github.com/actions/cache/issues/810
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-features
# Make sure benchmarks compile.
- name: cargo build benchmarks no-run
run: cargo test --verbose --release --all-features -p circuit-benchmarks --no-run
bitrot:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Bitrot check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-25
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://github.com/actions/cache/issues/810
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
- name: Cargo cache
uses: Swatinem/rust-cache@v2
# Build benchmarks to prevent bitrot
- name: Build benchmarks
run: cargo build --benches --examples --all-features
doc-links:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Intra-doc links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-25
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://github.com/actions/cache/issues/810
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: cargo fetch
run: cargo fetch
# Ensure intra-documentation links all resolve correctly
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
- name: Check intra-doc links
run: cargo doc --no-deps --all --document-private-items
fmt:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Rustfmt
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-25
components: rustfmt
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://github.com/actions/cache/issues/810
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: Cargo check
run: cargo check --all-features
- name: Cargo fmt
run: cargo fmt --all -- --check
typos-check:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: TyposCheck
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
with:
config: ./typos.toml
isolated: true