From 28a381ffb35ce1080b0eb9f41d58cd23ccd58ed1 Mon Sep 17 00:00:00 2001 From: Mateusz Pstrucha Date: Tue, 24 Nov 2026 20:22:21 +0100 Subject: [PATCH] Cache only cargo downloads; rust-cache isn't mirrored 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 --- .gitea/workflows/ci.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 20e4eef..bb77aa1 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -36,13 +36,22 @@ jobs: with: components: rustfmt, clippy - # rust-cache, not a plain actions/cache of target/: that one restored - # through the cargo- prefix and saved everything back, so stale - # artifacts piled up (1.2 GB by v0.8.4) and run #40 filled the shared - # runner's disk. rust-cache keeps only compiled dependencies, drops our - # own crate and stale files before saving, and turns off incremental. + # Downloads only, no target/: caching target/ through the cargo- + # restore prefix saved every stale artifact back, the cache reached + # 1.2 GB and run #40 filled the shared runner's disk. Dependencies are + # recompiled each run instead. (Swatinem/rust-cache would keep them, + # 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 - 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 run: cargo fmt --check