Created by Claude.
Every job in .github/workflows/ci.yml caches the same paths under the same key:
path: |
~/.cargo
~/.rustup
~/verus
rust-toolchain.toml
target
key: toolchain-${{ runner.os }}-${{ needs.setup-toolchain.outputs.verus-sha }}
Nothing ever puts an Anvil build into that target/. Only setup-toolchain writes the cache, and it builds Verus into $HOME/verus; it never builds Anvil. Every other job restores the same key, so its post-step finds the key present and saves nothing: Cache hit occurred on the primary key toolchain-Linux-…, not saving cache.
Each job therefore compiles Anvil from scratch and throws the result away. That is most of the 4m30s–5m13s each e2e job spends deploying its controller, and the ~2 minutes full-verification spends compiling before it verifies anything.
Fix
Split the one key into two caches with different lifecycles:
- Toolchain —
~/verus, ~/.rustup, rust-toolchain.toml, keyed on the Verus revision. This cache is immutable, so downstream jobs should use actions/cache/restore@v6 with fail-on-cache-miss: true.
- Build —
~/.cargo/registry, ~/.cargo/git, target/, keyed on the Verus revision plus a source hash, with a restore-keys: prefix fallback so a source change still restores a warm target/ and rebuilds only what changed. Swatinem/rust-cache handles that key management.
rust-toolchain.toml is generated by tools/setup-verus.sh and sits in the cache paths, so a restore overwrites the checked-out copy. Keeping it in the toolchain cache is fine, but be deliberate about it.
Created by Claude.
Every job in
.github/workflows/ci.ymlcaches the same paths under the same key:Nothing ever puts an Anvil build into that
target/. Onlysetup-toolchainwrites the cache, and it builds Verus into$HOME/verus; it never builds Anvil. Every other job restores the same key, so its post-step finds the key present and saves nothing:Cache hit occurred on the primary key toolchain-Linux-…, not saving cache.Each job therefore compiles Anvil from scratch and throws the result away. That is most of the 4m30s–5m13s each e2e job spends deploying its controller, and the ~2 minutes
full-verificationspends compiling before it verifies anything.Fix
Split the one key into two caches with different lifecycles:
~/verus,~/.rustup,rust-toolchain.toml, keyed on the Verus revision. This cache is immutable, so downstream jobs should useactions/cache/restore@v6withfail-on-cache-miss: true.~/.cargo/registry,~/.cargo/git,target/, keyed on the Verus revision plus a source hash, with arestore-keys:prefix fallback so a source change still restores a warmtarget/and rebuilds only what changed.Swatinem/rust-cachehandles that key management.rust-toolchain.tomlis generated bytools/setup-verus.shand sits in the cache paths, so a restore overwrites the checked-out copy. Keeping it in the toolchain cache is fine, but be deliberate about it.