ci: trial main-owned Rust caching - #679
Conversation
Signed-off-by: Alex Fournier <afournier@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review. WalkthroughThe CI workflow adds Rust dependency caching with binary caching disabled. Cache saves are restricted to the ChangesRust CI caching
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: 🟡 Moderate · up to This change speeds Rust CI through shared dependency caching, but pull-request jobs could access Cargo credentials if they are included in the main-branch cache. Confirming that credentials cannot enter the cached paths is needed before merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
A rabbit checks the Rusty trail Comment |
|
@grahamking for review |
What
Adds
Swatinem/rust-cacheto the existing Rust CI job.Pull requests can restore the cache, but only
mainsaves it.cache-bin: falsekeeps Cargo-installed binaries out. This follows the same pinned-action and main-writes pattern used by NeMo Relay's Rust CI, introduced as part of NVIDIA/NeMo-Relay#46.Why
Starts the trial described in #669.
Recent successful runs spend a median of 3m30s in the Rust job. Python currently takes longer, so I do not expect this to shorten the full workflow yet. It should reduce repeated Rust compilation and return Rust results sooner.
This is intentionally experimental. The first
mainrun will seed the cache, then we can compare 5-10 warm runs and inspect cache size, restore time, and Rust job duration. If the savings are not meaningful or the cache churn is too high, we should revert it.Scope
How tested
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 .github/workflows/ci.ymlgit diff --checkcargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspaceuv run ruff check .uv run mypy switchyardenv -u OPENROUTER_API_KEY -u NVIDIA_API_KEY -u OPENAI_API_KEY -u ANTHROPIC_API_KEY uv run pytest tests/ -v -m "not integration"- 117 passed, 2 deselectedNo live provider calls were made.
Notes for reviewers
The production diff is four YAML lines. A cache miss falls back to the normal Cargo build.
Summary by CodeRabbit