From 4ab4a8dc4ffd13c11bb2d6b4673842f96aaf65ae Mon Sep 17 00:00:00 2001 From: wtclaude Date: Mon, 2 Nov 2026 11:20:54 -0600 Subject: [PATCH] ci(pr-checks): cache cargo with rust-cache so the cache stops growing actions/cache restored the previous target/ through restore-keys and re-saved all of it under every new Cargo.lock hash, so each entry carried every older build and the runner's cache grew without bound. Swatinem/rust-cache strips the crate's own and stale artifacts before saving and saves only on a miss. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY --- .gitea/workflows/pr-checks.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/pr-checks.yml b/.gitea/workflows/pr-checks.yml index 1681efb..a6f5469 100644 --- a/.gitea/workflows/pr-checks.yml +++ b/.gitea/workflows/pr-checks.yml @@ -70,18 +70,17 @@ jobs: rustup component add rustfmt clippy cargo --version && cargo fmt --version && cargo clippy --version - # Keyed on Cargo.lock: dependency builds are reused until a dep actually - # changes. A cache miss only makes the run slower, never wrong. - - name: Cache cargo registry and build dir - uses: actions/cache@v4 + # Dependency builds are reused until a dep actually changes; a cache miss + # only makes the run slower, never wrong. rust-cache rather than a plain + # actions/cache of target/: it strips this crate's own artifacts and + # anything stale before saving, and saves only on a miss. The plain cache + # restored the previous target/ and re-saved all of it under every new + # Cargo.lock, so each entry carried every older build and the runner's + # cache grew without bound. + - name: Cache cargo registry and dependency builds + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - sidecar/target - key: ${{ runner.os }}-cargo-${{ hashFiles('sidecar/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + workspaces: sidecar -> target # Cheapest gate first — parses only, no compile, so a formatting slip # fails in seconds instead of after a full build.