Skip to content

ci: keep the rust caches lean and stop rebuilding for the example - #90

Merged
prrao87 merged 1 commit into
mainfrom
ci/rust-cache
Oct 30, 2026
Merged

prrao87 merged 1 commit into
mainfrom
ci/rust-cache

Conversation

@prrao87

@prrao87 prrao87 commented Oct 30, 2026

Copy link
Copy Markdown
Member

Why

A Rust test run takes about 4.5 minutes even when the cache works. Some of that time is avoidable, and the cache setup puts the warm cache itself at risk. The repository has used 9.8 GB of GitHub's 10 GB cache limit. When it's full, GitHub deletes the least recently used caches, and if main's 1.8 GB Rust cache goes, every run builds from scratch.

Where a typical run spent its time on main:

Step Time
Restore cache (1.8 GB) ~65 s
Build tests ~2 min
Run tests ~15 s
Run embedded example ~25 s, of which 22 s recompiled lance-csr

What changed

  • The example step runs the binary the test build already made. cargo test --workspace and cargo run -p lance-csr turn on different sets of crate features, so the old step compiled lance-csr a second time.
  • Only main saves caches. Every rust-cache step now sets save-if: ${{ github.ref == 'refs/heads/main' }}. Pull requests still restore main's cache, but they no longer save their own copies (about 4 GB for PRs 82 and 83).
  • No unused caches. setup-rust-toolchain saves a cache of its own by default. The format job stored 130 MB per branch that nothing used, and the Python test job was caching twice. Both now set cache: false.
  • A smaller cache. The Rust and Python test jobs now build with -C debuginfo=line-tables-only instead of -C debuginfo=1. Backtraces keep file and line numbers. The clippy job is unchanged because it doesn't generate code.

The flag change gives these jobs a new cache key. This PR's run and the first run on main after merging will build from scratch, and later runs restore the new, smaller cache.

Validation

  • actionlint passes on the three edited workflows.
  • Locally, cargo test --workspace --no-run creates target/debug/examples/embedded_query, which the new step runs.
  • Not yet measured: how much smaller the cache is and how long warm runs take. Both depend on the first main run after merging. This PR's CI will confirm the example step no longer prints Compiling.
  • I didn't delete the existing caches. Old PR caches expire after 7 days without use. The sccache entries from the v0.4.0 tag build (about 1 GB) can be deleted by hand.

🤖 Generated with Claude Code

Save rust-cache entries from main only, so pull request copies don't
push main's cache out of the 10 GB limit. Turn off setup-rust-toolchain's
own cache where rust-cache already runs or nothing compiles. Build with
line tables only to shrink the cache. Run the example binary the test
build already made instead of recompiling lance-csr with cargo run.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 52e1ea5
Status: ✅  Deploy successful!
Preview URL: https://fa9a8a56.lance-csr.pages.dev
Branch Preview URL: https://ci-rust-cache.lance-csr.pages.dev

View logs

@prrao87
prrao87 marked this pull request as ready for review October 30, 2026 14:43
@prrao87
prrao87 merged commit df85fa8 into main Oct 30, 2026
7 checks passed
@prrao87
prrao87 deleted the ci/rust-cache branch October 30, 2026 14:53
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