-
Notifications
You must be signed in to change notification settings - Fork 0
305 lines (283 loc) · 9.57 KB
/
Copy pathci.yml
File metadata and controls
305 lines (283 loc) · 9.57 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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
name: CI
on:
push:
branches: [main]
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
permissions:
contents: read
jobs:
lockfile:
name: Lockfile
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
- name: Validate Cargo.lock is up to date
run: cargo metadata --format-version 1 --no-deps --locked >/dev/null
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
free-disk: "true"
native-deps: "true"
mold: "true"
foundry: "true"
rust-cache-shared-key: "stable"
rust-cache-save: ${{ github.ref == 'refs/heads/main' }}
- run: just build::ci
test:
name: Test
runs-on: ubuntu-latest
env:
BASE_REF: ${{ github.base_ref || 'main' }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 0 || 1 }}
- name: Fetch base branch
if: github.event_name == 'pull_request'
run: git fetch origin "$BASE_REF":refs/remotes/origin/"$BASE_REF"
- uses: ./.github/actions/setup
with:
free-disk: "true"
native-deps: "true"
mold: "true"
foundry: "true"
tools: cargo-nextest
rust-cache-shared-key: "stable"
- name: Run tests
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
just test-affected-ci "origin/$BASE_REF"
else
just test-ci
fi
test-musl-sigsegv:
name: Test SIGSEGV (musl)
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
- name: Install musl toolchain
run: |
sudo apt-get update && sudo apt-get install -y musl-tools
rustup target add x86_64-unknown-linux-musl
- name: Run SIGSEGV tests under musl
run: cargo test --locked -p base-cli-utils --test sigsegv_test --target x86_64-unknown-linux-musl
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
toolchain: nightly
components: rustfmt
rust-cache-shared-key: "nightly"
rust-cache-save: ${{ github.ref == 'refs/heads/main' }}
- run: just check::format
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
free-disk: "true"
native-deps: "true"
mold: "true"
foundry: "true"
components: clippy
rust-cache-shared-key: "stable"
- run: just check::clippy-ci
changes:
name: Detect Changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
docker: ${{ steps.filter.outputs.docker }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
docker:
- 'etc/docker/Dockerfile.*'
- 'etc/docker/docker-bake.hcl'
- '.dockerignore'
docker:
name: Docker
runs-on: ubuntu-latest
needs: changes
if: github.event_name == 'push' || needs.changes.outputs.docker == 'true'
permissions:
contents: read
packages: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Login to GHCR
if: github.event.pull_request.head.repo.fork != true
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker buildx bake -f etc/docker/docker-bake.hcl client --load
bench:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
free-disk: "true"
native-deps: "true"
mold: "true"
rust-cache-shared-key: "stable"
- run: cargo bench --locked -p base-proof-mpt --bench trie_node -- --test
udeps:
name: udeps
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
free-disk: "true"
toolchain: nightly
native-deps: "true"
mold: "true"
foundry: "true"
tools: cargo-udeps
rust-cache-shared-key: "nightly"
- run: just check::udeps
crate-deps:
name: Crate Dependencies
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
- run: just check::crate-deps
deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
tools: cargo-deny
- run: just check::deny
devnet-tests:
name: Devnet Tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- uses: ./.github/actions/setup
with:
free-disk: "true"
native-deps: "true"
mold: "true"
foundry: "true"
tools: cargo-nextest
rust-cache-shared-key: "stable"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Pre-pull docker images
run: just devnet pull-images
- name: Run devnet tests
run: just devnet tests-ci