ci: replace manual cargo cache with Swatinem/rust-cache#68
Conversation
Replace all 5 instances of manual actions/cache configuration with Swatinem/rust-cache@v2 across build, lint, and test workflows. Benefits: - Smarter cache key (includes Cargo.lock + Cargo.toml + toolchain) - Auto-cleanup of stale target artifacts to prevent cache bloat - cache-on-failure saves cache even on build errors - Simpler configuration (3 lines vs 10+ lines per job)
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 24 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
chengwenxi
left a comment
There was a problem hiding this comment.
Code review: Approve
Clean, well-scoped CI improvement. All 4 manual actions/cache@v4 blocks are correctly replaced with Swatinem/rust-cache@v2. No cache block is missed, and the fmt job (which has no cache and doesn't need one) is correctly left untouched.
What this improves:
- Smarter cache keys (includes
Cargo.toml, rustc version, job ID -- not justCargo.lock) - Automatic target directory cleanup prevents cache bloat
cache-on-failure: truesaves partial compilation for faster retries- ~10 lines reduced to 3 lines per job
Verified:
Swatinem/rust-cacheis well-established (~1,770 stars, latest release v2.9.1 from 2026-03-12)- No unrelated changes, no security concerns
- Workflow triggers, permissions, env vars, toolchain setup, and build/test commands are all untouched
chengwenxi
left a comment
There was a problem hiding this comment.
LGTM. Swatinem/rust-cache@v2 is the de facto standard — better cache keys (factors in Cargo.toml + rustc version), automatic target pruning, and cache-on-failure: true for retry perf. All 4 manual cache blocks correctly replaced.
Summary
actions/cachewithSwatinem/rust-cache@v2across build, lint, and test workflowscache-on-failure: truesaves cache even on build errors for faster retriesTest plan