Cache only cargo downloads; rust-cache isn't mirrored
CI / test (push) Successful in 2m19s

The runner resolves actions from git.app.ygg, where Swatinem/rust-cache
doesn't exist, so run #46 failed before checkout. Cache the registry
index, crate archives and git db instead, never target/, under a new
cargo-v2- key so the old target/-laden caches aren't restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mateusz PstruchaandClaude Opus 5.5 committed 2026-11-24 20:22:21 +01:00
1 parent 546d629d36
commit 28a381ffb3
1 file changed
+15 -6
+15 -6
View File
@@ -36,13 +36,22 @@ jobs:
with: with:
components: rustfmt, clippy components: rustfmt, clippy
# rust-cache, not a plain actions/cache of target/: that one restored # Downloads only, no target/: caching target/ through the cargo-
# through the cargo- prefix and saved everything back, so stale # restore prefix saved every stale artifact back, the cache reached
# artifacts piled up (1.2 GB by v0.8.4) and run #40 filled the shared # 1.2 GB and run #40 filled the shared runner's disk. Dependencies are
# runner's disk. rust-cache keeps only compiled dependencies, drops our # recompiled each run instead. (Swatinem/rust-cache would keep them,
# own crate and stale files before saving, and turns off incremental. # but the runner resolves actions from git.app.ygg and it isn't
# mirrored there.) The key has a v2 prefix so no old cache with target/
# in it is restored.
- name: Cache cargo - name: Cache cargo
uses: Swatinem/rust-cache@v2 uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-v2-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-v2-
- name: Check formatting - name: Check formatting
run: cargo fmt --check run: cargo fmt --check