Skip to content

Commit 1708184

Browse files
committed
Adjust the caching some more and debuggin
1 parent 14d98ca commit 1708184

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

.github/workflows/verify-pr-commit.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ jobs:
150150
uses: actions/cache@v4
151151
with:
152152
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')}}
154154
restore-keys: |
155-
cargo-registry-${{matrix.build-profile}}-${{github.ref_name}}-
155+
cargo-${{matrix.build-profile}}-${{github.ref_name}}-
156+
cargo-${{matrix.build-profile}}-
156157
- name: cargo fetch for ${{matrix.build-profile}}
157158
run: |
158159
cargo fetch --locked
@@ -230,9 +231,10 @@ jobs:
230231
uses: actions/cache/restore@v4
231232
with:
232233
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
236238
# # XXX Keep this step as it lets us skip full binary builds during development/testing
237239
# - name: Cache Binary for Testing
238240
# id: cache-binary
@@ -289,8 +291,15 @@ jobs:
289291
steps:
290292
- name: Check Out Repository
291293
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')}}
292299
- name: Verify Rust Code Formatting
293300
run: |
301+
whoami
302+
rustup +${{env.NIGHTLY_TOOLCHAIN}} show
294303
cargo +${{env.NIGHTLY_TOOLCHAIN}} fmt --check
295304
296305
lint-rust-code:
@@ -306,9 +315,7 @@ jobs:
306315
uses: actions/cache/restore@v4
307316
with:
308317
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')}}
312319
- name: Lint
313320
# Fail on warnings
314321
run: |
@@ -329,9 +336,7 @@ jobs:
329336
uses: actions/cache/restore@v4
330337
with:
331338
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')}}
335340
- name: Build Docs
336341
run: |
337342
RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" cargo doc --no-deps --workspace --locked --features frequency
@@ -349,9 +354,7 @@ jobs:
349354
uses: actions/cache/restore@v4
350355
with:
351356
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')}}
355358
- name: Check
356359
run: SKIP_WASM_BUILD= cargo check --locked --features runtime-benchmarks,frequency-lint-check
357360

@@ -371,9 +374,7 @@ jobs:
371374
uses: actions/cache/restore@v4
372375
with:
373376
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')}}
377378
- name: Run Tests
378379
run: cargo test --locked --features runtime-benchmarks,frequency-lint-check --workspace
379380

@@ -390,9 +391,7 @@ jobs:
390391
uses: actions/cache/restore@v4
391392
with:
392393
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')}}
396395
- name: Generate and Upload Code Coverage
397396
id: codecov
398397
uses: ./.github/workflows/common/codecov
@@ -450,9 +449,7 @@ jobs:
450449
uses: actions/cache/restore@v4
451450
with:
452451
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')}}
456453
- name: Extract Runtime Spec Version
457454
run: |
458455
echo "RUNTIME_SPEC_VERSION=$(awk '/spec_version:/ {match($0, /[0-9]+/); print substr($0, RSTART, RLENGTH); exit}' \

0 commit comments

Comments
 (0)