ci(pr-checks): cache cargo with rust-cache so the cache stops growing #44

Merged
whitlocktech merged 1 commits from chore/ci-self-cleanup into main 2026-11-04 06:10:29 -06:00
Member

What & why

The CI runners are filling up. Runner 65 (ubuntu-latest) is out of disk right now: every recent
task it took died at checkout with No space left on device.

This repo's PR gate cached ~/.cargo/registry, ~/.cargo/git and the whole target/ with
actions/cache, keyed on Cargo.lock with a prefix restore-keys. When Cargo.lock changed, the
job restored the previous target/ through the prefix, built on top of it, and saved everything
under the new key. So every entry carried every older build, and the runner's cache store grew
without bound.

The step is now Swatinem/rust-cache@v2. It caches the same things, but before saving it strips
this crate's own artifacts and anything stale from target/, and it saves only on a cache miss.
Each entry stays about the size of the dependency builds. The fmt / clippy / test gates are unchanged.

Companion PRs: link / installer / Rust-Link (this same change), website and runicgateway.com
(docker build clean-up), docs.

How it was tested

  • The changed workflow parses (PyYAML) with the expected jobs and steps.
  • This PR's own PR Checks run is the live test: the first run is a miss and saves; a re-run
    should restore from the cache.

Checklist

  • I have read CONTRIBUTING.md.
  • The change builds and existing tests/checks pass locally.
  • I have added or updated tests/docs where it makes sense.
  • My commits are reasonably scoped with clear messages.

AI-assisted contributions (required)

  • No AI tools were used to produce this contribution.
  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). I have reviewed and understand
    every change, and take responsibility for it. AI-authored commits are
    marked with a Co-Authored-By / Assisted-By trailer.

License

  • I agree that my contribution is licensed under this project's license
    (GNU GPL v3.0 or later), and I have the right to contribute it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

## What & why The CI runners are filling up. Runner 65 (`ubuntu-latest`) is out of disk right now: every recent task it took died at checkout with `No space left on device`. This repo's PR gate cached `~/.cargo/registry`, `~/.cargo/git` **and the whole `target/`** with `actions/cache`, keyed on `Cargo.lock` with a prefix `restore-keys`. When `Cargo.lock` changed, the job restored the previous `target/` through the prefix, built on top of it, and saved everything under the new key. So every entry carried every older build, and the runner's cache store grew without bound. The step is now `Swatinem/rust-cache@v2`. It caches the same things, but before saving it strips this crate's own artifacts and anything stale from `target/`, and it saves only on a cache miss. Each entry stays about the size of the dependency builds. The fmt / clippy / test gates are unchanged. Companion PRs: link / installer / Rust-Link (this same change), website and runicgateway.com (docker build clean-up), docs. ## How it was tested - The changed workflow parses (PyYAML) with the expected jobs and steps. - This PR's own `PR Checks` run is the live test: the first run is a miss and saves; a re-run should restore from the cache. ## Checklist - [x] I have read CONTRIBUTING.md. - [x] The change builds and existing tests/checks pass locally. - [x] I have added or updated tests/docs where it makes sense. - [x] My commits are reasonably scoped with clear messages. ## AI-assisted contributions (required) - [ ] No AI tools were used to produce this contribution. - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` / `Assisted-By` trailer. ## License - [x] I agree that my contribution is licensed under this project's license (**GNU GPL v3.0 or later**), and I have the right to contribute it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-11-02 11:22:16 -06:00
ci(pr-checks): cache cargo with rust-cache so the cache stops growing
All checks were successful
PR Checks / rust-gates (pull_request) Successful in 4m2s
52b0c53846
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech approved these changes 2026-11-04 06:10:22 -06:00
whitlocktech merged commit 485dc07288 into main 2026-11-04 06:10:29 -06:00
whitlocktech deleted branch chore/ci-self-cleanup 2026-11-04 06:10:31 -06:00
Sign in to join this conversation.
No description provided.