ci(maestro): cache nix store, trim CI hot paths #132

Merged
naps62-yolo merged 1 commits from ci into main 2026-09-02 17:53:56 +01:00
Collaborator

The flake job was the pipeline critical path at ~9 minutes, all of it one cold nix build — an empty /nix every run means recompiling the whole release closure under lto = "thin" + codegen-units = 1.

  • Cache /nix across runs, keyed on the lockfiles the closure derives from, so crane deps-only derivation survives and only maestro own crates rebuild. Saved from pushes only, so a PR cannot write a partial store.
  • Build only .#webFrontend on PRs — the step that guards pnpmDeps.hash. Release binaries stay on main. Trade-off: a Nix-packaging-specific break surfaces on main, not on the PR.
  • Swatinem/rust-cache replaces the hand-rolled target/ cache, which accumulated stale artifacts behind a prefix restore-key and cost ~60s per run to move.
  • Tests run under cargo-nextest, capped at 4 threads in .config/nextest.toml — the tmux-backed tests starve each other at the num-cpus default and trip their 5s deadlines.
  • actions/setup-node instead of a second apt-get pass via nodesource.
Measured before
job total breakdown
flake 557s nix build 516s
rust 235s cache 62s, test 69s, feature matrix 41s
web 100s —
The `flake` job was the pipeline critical path at ~9 minutes, all of it one cold `nix build` — an empty /nix every run means recompiling the whole release closure under `lto = "thin"` + `codegen-units = 1`. - Cache `/nix` across runs, keyed on the lockfiles the closure derives from, so crane deps-only derivation survives and only maestro own crates rebuild. Saved from pushes only, so a PR cannot write a partial store. - Build only `.#webFrontend` on PRs — the step that guards `pnpmDeps.hash`. Release binaries stay on main. Trade-off: a Nix-packaging-specific break surfaces on main, not on the PR. - Swatinem/rust-cache replaces the hand-rolled `target/` cache, which accumulated stale artifacts behind a prefix restore-key and cost ~60s per run to move. - Tests run under cargo-nextest, capped at 4 threads in `.config/nextest.toml` — the tmux-backed tests starve each other at the num-cpus default and trip their 5s deadlines. - actions/setup-node instead of a second apt-get pass via nodesource. <details> <summary>Measured before</summary> | job | total | breakdown | |---|---|---| | flake | 557s | nix build 516s | | rust | 235s | cache 62s, test 69s, feature matrix 41s | | web | 100s | — | </details>
naps62-yolo added 1 commit 2026-09-02 17:48:45 +01:00
ci(maestro): cache nix store, trim CI hot paths
ci / web (pull_request) Successful in 40s
ci / flake (pull_request) Successful in 3m58s
ci / rust (pull_request) Successful in 4m36s
64d5829037
The `flake` job was the pipeline's critical path at ~9 minutes, all of it
one cold `nix build`: with an empty /nix every run, it recompiled the whole
release closure under `lto = "thin"` + `codegen-units = 1`.

- Cache /nix across runs, keyed on the lockfiles the closure derives from,
  so crane's deps-only derivation survives and only maestro's own crates
  rebuild. Saved from pushes only, so a PR cannot write a partial store.
- Build only `.#webFrontend` on PRs — that is the step that guards
  pnpmDeps.hash. The release binaries stay on main.
- Replace the hand-rolled `target/` cache with Swatinem/rust-cache, which
  prunes to the current lockfile instead of accumulating stale artifacts
  behind a prefix restore-key. ~60s per run went into moving that entry.
- Run tests under cargo-nextest, which parallelises across the 20
  integration binaries. Capped at 4 threads in .config/nextest.toml: the
  tmux-backed tests starve each other at the num-cpus default and trip
  their 5s deadlines.
- actions/setup-node instead of a second apt-get pass via nodesource.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
naps62-yolo merged commit f84199d292 into main 2026-09-02 17:53:56 +01:00
naps62-yolo deleted branch ci 2026-09-02 17:53:56 +01:00
This repo is archived. You cannot comment on pull requests.