fix: cache what installs actually reuse, and keep it when a test fails #102

Merged
cjournois merged 1 commit from fix/runner-cache into main 2026-11-09 19:25:45 +00:00
Collaborator

Why

The runner-cache audit found the caches miss what installs reuse:

  • telos's bun deps entry is 2 MB, because ci wipes node_modules, so every run re-downloads packages.
  • janus's mise cache hits, but mise install still takes 43s, because rustup's toolchain lives in ~/.rustup, outside it. cargo audit also re-clones its advisory DB (28s).
  • Playwright browsers were restored after the Test step that installs nested units' Chromium.
  • Deps were never saved when a test failed.

What

  • bun/npm units cache ~/.bun/install/cache or ~/.npm; rust adds ~/.cargo/advisory-db.
  • setup (live from @main on merge): a mise.toml pinning rust adds RUSTUP_HOME and $CARGO_HOME/bin to the mise cache under a -rustup key, so only rust units take one cold run.
  • Package stores and rust builds fall back to the unit's latest entry (cache_restore); python venvs don't.
  • cache/restore + cache/save: deps save after Build, even on a failed test, unless the install failed.
  • Playwright restores before Test, falling back to the latest entry.
  • Docs updated.

Check

just lint test green, with new bats for the store choice, the restore prefix and rust detection.

Session: 60ac4614-d609-4e43-a004-27bdaf30476c

## Why The runner-cache audit found the caches miss what installs reuse: - telos's bun deps entry is 2 MB, because `ci` wipes `node_modules`, so every run re-downloads packages. - janus's mise cache hits, but `mise install` still takes 43s, because rustup's toolchain lives in `~/.rustup`, outside it. `cargo audit` also re-clones its advisory DB (28s). - Playwright browsers were restored after the Test step that installs nested units' Chromium. - Deps were never saved when a test failed. ## What - bun/npm units cache `~/.bun/install/cache` or `~/.npm`; rust adds `~/.cargo/advisory-db`. - `setup` (live from `@main` on merge): a mise.toml pinning `rust` adds `RUSTUP_HOME` and `$CARGO_HOME/bin` to the mise cache under a `-rustup` key, so only rust units take one cold run. - Package stores and rust builds fall back to the unit's latest entry (`cache_restore`); python venvs don't. - `cache/restore` + `cache/save`: deps save after Build, even on a failed test, unless the install failed. - Playwright restores before Test, falling back to the latest entry. - Docs updated. ## Check `just lint test` green, with new bats for the store choice, the restore prefix and rust detection. Session: 60ac4614-d609-4e43-a004-27bdaf30476c
fix: cache what installs actually reuse, and keep it when a test fails
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 1m10s
ci: reusable-pipeline / CI Pipeline (push) Successful in 44s
b1dc45e7a7
bun and npm units cache the package store, not the node_modules ci wipes;
rust adds advisory-db, and a rust pin adds rustup's toolchains to mise's.
Stores and rust builds restore the latest entry on a lockfile change;
deps save after Build even on a failed test; Playwright restores first.

Session: 60ac4614-d609-4e43-a004-27bdaf30476c
cjournois deleted branch fix/runner-cache 2026-11-09 19:25:45 +00:00
Sign in to join this conversation.
No reviewers
No labels
needs-human
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cjournois/reusable-pipeline!102
No description provided.