Skip to content

ci: trial main-owned Rust caching - #679

Merged
ayushag-nv merged 1 commit into
mainfrom
codex/ci-rust-cache-trial
Sep 11, 2026
Merged

ci: trial main-owned Rust caching#679
ayushag-nv merged 1 commit into
mainfrom
codex/ci-rust-cache-trial

Conversation

@afourniernv

@afourniernv afourniernv commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds Swatinem/rust-cache to the existing Rust CI job.

Pull requests can restore the cache, but only main saves it. cache-bin: false keeps 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 main run 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

  • Only the core Rust job is cached.
  • No custom cache keys or workspace-crate caching.
  • Python, docs, portability, performance, publishing, and release workflows are unchanged.
  • No public API, runtime dependency, package, or release behavior changes.

How tested

  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 .github/workflows/ci.yml
  • git diff --check
  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • uv run ruff check .
  • uv run mypy switchyard
  • env -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 deselected

No 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

  • Chores
    • Improved Rust CI caching to reduce unnecessary cache storage and limit cache updates to the main branch.

Signed-off-by: Alex Fournier <afournier@nvidia.com>
@afourniernv
afourniernv requested a review from a team as a code owner September 10, 2026 21:05
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ebac3699-55c9-4609-95c7-a061c95c065c

📥 Commits

Reviewing files that changed from the base of the PR and between a70a1fb and 99abbe4.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review.


Walkthrough

The CI workflow adds Rust dependency caching with binary caching disabled. Cache saves are restricted to the main branch.

Changes

Rust CI caching

Layer / File(s) Summary
Configure Rust dependency caching
.github/workflows/ci.yml
The workflow uses Swatinem/rust-cache v2.9.1. Binary caching is disabled. Cache saves occur only on refs/heads/main.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: 🟡 Moderate · up to 99abb

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: an experimental Rust cache trial where cache ownership is restricted to the main branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

A rabbit checks the Rusty trail
Cache crumbs wait where builds prevail
Binaries stay tucked away
Main branch saves them for the day
CI hops faster through the hay

Comment @coderabbitai help to get the list of available commands.

@ayushag-nv

Copy link
Copy Markdown
Contributor

@grahamking for review

@ayushag-nv
ayushag-nv merged commit 50c93d6 into main Sep 11, 2026
16 checks passed
@ayushag-nv
ayushag-nv deleted the codex/ci-rust-cache-trial branch September 11, 2026 16:56
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.

3 participants