Skip to content

chore: share Rust cache across CI jobs#340

Merged
jdx merged 1 commit intomainfrom
chore/share-rust-cache
Mar 8, 2026
Merged

chore: share Rust cache across CI jobs#340
jdx merged 1 commit intomainfrom
chore/share-rust-cache

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Mar 8, 2026

Summary

  • Use shared-key per OS so build, ci-other, autofix, and release-plz all share one Rust cache instead of each maintaining its own
  • Only ci-other saves the cache (on main merges) since it has the most complete artifacts (test + clippy)
  • msrv keeps a separate key since it uses a different Rust toolchain
  • Reduces from ~6 unique cache keys (~10.8 GB) down to 3

Test plan

  • Verify autofix job gets a cache hit instead of compiling 547 crates from scratch
  • Verify build and ci-other jobs still get cache hits
  • Verify cache is saved on main merge

🤖 Generated with Claude Code


Note

Low Risk
Workflow-only changes affecting CI caching behavior; low risk beyond potential cache misses or slightly longer CI runs if misconfigured.

Overview
Consolidates Rust caching across GitHub Actions workflows. autofix, build, ci-other, and release-plz now use a per-OS shared-key (e.g., debug-ubuntu-latest, debug-macos-latest) so they can reuse the same cache instead of creating separate ones.

Cache writes are tightened: most jobs set save-if: false, while ci-other (and msrv under its own shared-key) only saves the cache on refs/heads/main to reduce cache churn and size.

Written by Cursor Bugbot for commit cf43c58. This will update automatically on new commits. Configure here.

Use shared-key per OS so build, ci-other, autofix, and release-plz
share one cache instead of each maintaining its own. Only ci-other
saves (on main) since it has the most complete artifacts (test + clippy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 8, 2026

Greptile Summary

This PR consolidates the Rust compilation cache across all CI jobs from ~6 distinct keys (~10.8 GB) down to 3 shared keys (debug-ubuntu-latest, debug-macos-latest, msrv), reducing cache storage and improving cache hit rates for jobs like autofix and release-plz that previously had to compile from scratch.

  • ci-other is designated as the sole cache writer (on main merges only), seeding a complete cache with test + clippy artifacts that all other jobs can reuse.
  • build, autofix, and release-plz are read-only consumers (save-if: false), preventing cache churn.
  • msrv retains a separate key since it uses a different Rust toolchain.
  • On a cold-cache run (first run or after expiry), build and ci-other both compile independently since build never saves — this double compilation is an accepted trade-off for keeping the cache authoritative.
  • No functional code changes; impact is purely on CI performance and cache storage.

Confidence Score: 5/5

  • This PR is safe to merge — it only touches CI workflow cache configuration with no functional code changes.
  • All three cache keys are logically correct, the read-only vs. read-write split aligns perfectly with the stated strategy, and there are no competing writes to the same key from concurrent jobs. The only trade-off (double compilation on cold cache) is intentional and documented.
  • No files require special attention.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    MAIN[Main Branch Push] --> BUILD_U[build - ubuntu-latest\nsave-if: false]
    MAIN --> BUILD_M[build - macos-latest\nsave-if: false]
    MAIN --> CIO_U[ci-other - ubuntu-latest\nsave-if: true on main]
    MAIN --> CIO_M[ci-other - macos-latest\nsave-if: true on main]
    MAIN --> MSRV[msrv\nsave-if: true on main]
    MAIN --> RP[release-plz\nsave-if: false]

    PR[PR Trigger] --> AUTOFIX[autofix\nsave-if: false]

    subgraph CACHE["GitHub Actions Cache"]
        C1["debug-ubuntu-latest"]
        C2["debug-macos-latest"]
        C3["msrv"]
    end

    BUILD_U -- reads --> C1
    BUILD_M -- reads --> C2
    CIO_U -- reads + writes --> C1
    CIO_M -- reads + writes --> C2
    MSRV -- reads + writes --> C3
    RP -- reads --> C1
    AUTOFIX -- reads --> C1
Loading

Last reviewed commit: cf43c58

@jdx jdx enabled auto-merge (squash) March 8, 2026 22:40
@jdx jdx merged commit ed6d42e into main Mar 8, 2026
18 checks passed
@jdx jdx deleted the chore/share-rust-cache branch March 8, 2026 22:55
jdx pushed a commit that referenced this pull request Mar 9, 2026
### 🚀 Features

- **(cloudflare)** add Cloudflare API token lease backend by
[@jdx](https://github.com/jdx) in
[#335](#335)
- **(fido2)** bump demand to v2, mask PIN during typing by
[@jdx](https://github.com/jdx) in
[#334](#334)
- **(init)** add -f as short alias for --force by
[@jdx](https://github.com/jdx) in
[#329](#329)
- **(lease)** add --all flag, default to creating all leases by
[@jdx](https://github.com/jdx) in
[#337](#337)
- **(lease)** add GitHub App installation token lease backend by
[@jdx](https://github.com/jdx) in
[#342](#342)

### 🐛 Bug Fixes

- **(config)** fix directory locations to follow XDG spec by
[@jdx](https://github.com/jdx) in
[#336](#336)
- **(exec)** use unix exec and exit silently on subprocess failure by
[@jdx](https://github.com/jdx) in
[#339](#339)
- **(fido2)** remove duplicate touch prompt by
[@jdx](https://github.com/jdx) in
[#332](#332)
- **(set)** write to lowest-priority existing config file by
[@jdx](https://github.com/jdx) in
[#331](#331)
- **(tui)** skip providers requiring interactive auth by
[@jdx](https://github.com/jdx) in
[#333](#333)

### 🛡️ Security

- **(ci)** retry lint step to handle transient pkl fetch failures by
[@jdx](https://github.com/jdx) in
[#341](#341)
- **(mcp)** add MCP server for secret-gated AI agent access by
[@jdx](https://github.com/jdx) in
[#343](#343)
- add guide for fnox sync by [@jdx](https://github.com/jdx) in
[#328](#328)

### 🔍 Other Changes

- share Rust cache across CI jobs by [@jdx](https://github.com/jdx) in
[#340](#340)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant