@@ -150,9 +150,10 @@ jobs:
150
150
uses : actions/cache@v4
151
151
with :
152
152
path : ~/.cargo/
153
- key : cargo-registry- ${{matrix.build-profile}}-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
153
+ key : cargo-${{matrix.build-profile}}-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
154
154
restore-keys : |
155
- cargo-registry-${{matrix.build-profile}}-${{github.ref_name}}-
155
+ cargo-${{matrix.build-profile}}-${{github.ref_name}}-
156
+ cargo-${{matrix.build-profile}}-
156
157
- name : cargo fetch for ${{matrix.build-profile}}
157
158
run : |
158
159
cargo fetch --locked
@@ -230,9 +231,10 @@ jobs:
230
231
uses : actions/cache/restore@v4
231
232
with :
232
233
path : ~/.cargo/
233
- key : cargo-registry-${{matrix.build-profile}}-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
234
- restore-keys : |
235
- cargo-registry-${{matrix.build-profile}}-${{github.ref_name}}-
234
+ key : cargo-${{matrix.build-profile}}-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
235
+ - name : Check cache hit
236
+ if : steps.cache.outputs.cache-hit != 'true'
237
+ run : echo "Something is wrong, no cache found!" && exit 1
236
238
# # XXX Keep this step as it lets us skip full binary builds during development/testing
237
239
# - name: Cache Binary for Testing
238
240
# id: cache-binary
@@ -289,8 +291,15 @@ jobs:
289
291
steps :
290
292
- name : Check Out Repository
291
293
uses : actions/checkout@v4
294
+ - name : Rust Cache Restore
295
+ uses : actions/cache/restore@v4
296
+ with :
297
+ path : ~/.cargo/
298
+ key : cargo-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
292
299
- name : Verify Rust Code Formatting
293
300
run : |
301
+ whoami
302
+ rustup +${{env.NIGHTLY_TOOLCHAIN}} show
294
303
cargo +${{env.NIGHTLY_TOOLCHAIN}} fmt --check
295
304
296
305
lint-rust-code :
@@ -306,9 +315,7 @@ jobs:
306
315
uses : actions/cache/restore@v4
307
316
with :
308
317
path : ~/.cargo/
309
- key : cargo-registry-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
310
- restore-keys : |
311
- cargo-registry-debug-${{github.ref_name}}-
318
+ key : cargo-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
312
319
- name : Lint
313
320
# Fail on warnings
314
321
run : |
@@ -329,9 +336,7 @@ jobs:
329
336
uses : actions/cache/restore@v4
330
337
with :
331
338
path : ~/.cargo/
332
- key : cargo-registry-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
333
- restore-keys : |
334
- cargo-registry-debug-${{github.ref_name}}-
339
+ key : cargo-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
335
340
- name : Build Docs
336
341
run : |
337
342
RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" cargo doc --no-deps --workspace --locked --features frequency
@@ -349,9 +354,7 @@ jobs:
349
354
uses : actions/cache/restore@v4
350
355
with :
351
356
path : ~/.cargo/
352
- key : cargo-registry-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
353
- restore-keys : |
354
- cargo-registry-debug-${{github.ref_name}}-
357
+ key : cargo-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
355
358
- name : Check
356
359
run : SKIP_WASM_BUILD= cargo check --locked --features runtime-benchmarks,frequency-lint-check
357
360
@@ -371,9 +374,7 @@ jobs:
371
374
uses : actions/cache/restore@v4
372
375
with :
373
376
path : ~/.cargo/
374
- key : cargo-registry-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
375
- restore-keys : |
376
- cargo-registry-debug-${{github.ref_name}}-
377
+ key : cargo-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
377
378
- name : Run Tests
378
379
run : cargo test --locked --features runtime-benchmarks,frequency-lint-check --workspace
379
380
@@ -390,9 +391,7 @@ jobs:
390
391
uses : actions/cache/restore@v4
391
392
with :
392
393
path : ~/.cargo/
393
- key : cargo-registry-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
394
- restore-keys : |
395
- cargo-registry-debug-${{github.ref_name}}-
394
+ key : cargo-debug-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
396
395
- name : Generate and Upload Code Coverage
397
396
id : codecov
398
397
uses : ./.github/workflows/common/codecov
@@ -450,9 +449,7 @@ jobs:
450
449
uses : actions/cache/restore@v4
451
450
with :
452
451
path : ~/.cargo/
453
- key : cargo-registry-${{matrix.build-profile}}-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
454
- restore-keys : |
455
- cargo-registry-${{matrix.build-profile}}-${{github.ref_name}}-
452
+ key : cargo-${{matrix.build-profile}}-${{github.ref_name}}-${{hashFiles('**/Cargo.lock')}}
456
453
- name : Extract Runtime Spec Version
457
454
run : |
458
455
echo "RUNTIME_SPEC_VERSION=$(awk '/spec_version:/ {match($0, /[0-9]+/); print substr($0, RSTART, RLENGTH); exit}' \
0 commit comments