Skip to content

perf(ci): cache Rust compilation with sccache#6617

Merged
matthewevans merged 1 commit into
mainfrom
ship/perf-ci-cache-rust-compilation
Jul 25, 2026
Merged

perf(ci): cache Rust compilation with sccache#6617
matthewevans merged 1 commit into
mainfrom
ship/perf-ci-cache-rust-compilation

Conversation

@matthewevans

@matthewevans matthewevans commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Improved Rust build performance in automated checks by enabling compilation caching.
    • Applied caching across linting, testing, and card-data validation workflows.

@matthewevans
matthewevans enabled auto-merge July 25, 2026 02:48
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The CI workflow installs and enables sccache in the Rust lint, Rust test, and card-data gate jobs by configuring GitHub Actions caching and Rust compiler wrapper environment variables.

Changes

CI compilation caching

Layer / File(s) Summary
Enable sccache across Rust CI jobs
.github/workflows/ci.yml
The rust-lint, rust-test, and card-data-gate jobs install sccache and set SCCACHE_GHA_ENABLED=true and RUSTC_WRAPPER=sccache for subsequent commands.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ntindle

🚥 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 accurately summarizes the main change: enabling sccache to cache Rust compilation in CI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ship/perf-ci-cache-rust-compilation

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 49-55: Update the three sccache-enabled Rust jobs around the
“Enable sccache” steps to set CARGO_INCREMENTAL=0 in each job’s environment,
ensuring incremental compilation is disabled while preserving the existing
sccache configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d2a10795-a0c7-456e-b054-a6efbac8550d

📥 Commits

Reviewing files that changed from the base of the PR and between f027bd9 and 3c445c7.

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

Comment thread .github/workflows/ci.yml
Comment on lines +49 to +55
- uses: mozilla-actions/sccache-action@v0.0.10

- name: Enable sccache
run: |
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

while IFS= read -r file; do
  echo "== $file =="
  rg -n '^\[profile|^\s*incremental\s*=' "$file" || true
done < <(fd -t f '^Cargo\.toml$')

echo "== Workflow overrides =="
rg -n 'CARGO_INCREMENTAL|RUSTC_WRAPPER|SCCACHE_GHA_ENABLED' .github/workflows/ci.yml

Repository: phase-rs/phase

Length of output: 204


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== workflow =="
cat -n .github/workflows/ci.yml | sed -n '1,260p'

echo "== cargo tomls =="
find . -name Cargo.toml -print | sort | while IFS= read -r file; do
  echo "== $file =="
  cat -n "$file" | sed -n '1,220p'
done

Repository: phase-rs/phase

Length of output: 34951


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== config files =="
find . -path '*/.cargo/config.toml' -o -path './.cargo/config.toml' -o -path './Cargo.toml' | sort

echo "== incremental/profile search =="
rg -n 'incremental\s*=|\[profile\.ci\]|\[profile\.test\]|\[profile\.dev\]|CARGO_INCREMENTAL|profile ci' . \
  --glob '!.git' \
  --glob '!**/target/**' \
  --glob '!**/node_modules/**' || true

echo "== .cargo/config.toml =="
if [ -f .cargo/config.toml ]; then
  cat -n .cargo/config.toml
fi

Repository: phase-rs/phase

Length of output: 3531


Disable incremental compilation for the sccache jobs
These Rust jobs don’t set CARGO_INCREMENTAL=0 or override incremental in the active Cargo profiles, so sccache may miss the main workspace compiles. Set CARGO_INCREMENTAL=0 for the three sccache-enabled jobs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 49 - 55, Update the three
sccache-enabled Rust jobs around the “Enable sccache” steps to set
CARGO_INCREMENTAL=0 in each job’s environment, ensuring incremental compilation
is disabled while preserving the existing sccache configuration.

Source: MCP tools

@matthewevans
matthewevans added this pull request to the merge queue Jul 25, 2026
Merged via the queue into main with commit dddd313 Jul 25, 2026
15 checks passed
@matthewevans
matthewevans deleted the ship/perf-ci-cache-rust-compilation branch July 25, 2026 03:26
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