Skip to content

CI: target/ is in the cache paths but never actually persists any Anvil build #26

Description

@rosenhouse

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions