Skip to content

ci: stop sccache flooding the Actions cache quota#460

Merged
pratyush618 merged 2 commits into
masterfrom
fix/ci-cache-thrash
Jul 19, 2026
Merged

ci: stop sccache flooding the Actions cache quota#460
pratyush618 merged 2 commits into
masterfrom
fix/ci-cache-thrash

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Actions cache quota (10 GB) repeatedly hit its limit — 1,750+ caches, almost all sccache/<hash> entries scoped to a single PR ref.

Root cause: ci-python.yml set SCCACHE_GHA_ENABLED: true, so sccache used the Actions cache API as its backend and wrote one cache entry per compiled rustc object. A full --release maturin build across the matrix minted thousands of tiny entries per push. PR-ref caches can't be read by other PRs, so it was pure churn that evicted the caches that matter.

Fix

  • Drop sccache. Cache the release target/ via the existing Swatinem/rust-cache under a dedicated release shared-key — one consolidated entry per OS, master-only writer, PRs restore read-only. Added a shared-key input to the setup-rust composite to keep it separate from the lint job's dev cache.
  • Make the Rust lint job a master-only cache writer too (was saving one dev cache per PR ref = unreadable by other PRs = wasted quota).

Net: ~1 release cache/OS + 1 lint cache on master, vs thousands per PR. Entry count drops ~100×.

Existing 1,416 caches already cleared.

Summary by CodeRabbit

  • Chores
    • Improved CI build caching for Rust projects to speed up repeated builds.
    • Shared cache keys can now be configured for Rust setup workflows.
    • Limited cache updates to the master branch while allowing pull requests to restore existing caches.

sccache's GHA backend wrote one cache entry per compiled object, flooding
the 10 GB repo quota with thousands of per-PR entries and thrashing the
useful caches. Cache the release target/ as a single consolidated entry
instead, master-only writer.
PR-ref caches can't be read by other PRs, so saving the dev cache on every
PR just mints throwaway entries against the 10 GB quota.
@github-actions github-actions Bot added the ci label Jul 19, 2026
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e536284-c80a-46bc-a562-3616262c899d

📥 Commits

Reviewing files that changed from the base of the PR and between 807db05 and eaba035.

📒 Files selected for processing (3)
  • .github/actions/setup-rust/action.yml
  • .github/workflows/ci-python.yml
  • .github/workflows/ci-rust.yml

📝 Walkthrough

Walkthrough

Rust CI caching now supports an optional shared namespace, replaces Python-job sccache usage with release artifact caching, and restricts shared cache writes to the master branch.

Changes

Rust cache behavior

Layer / File(s) Summary
Shared cache input wiring
.github/actions/setup-rust/action.yml
Adds the optional shared-key input and forwards it to Swatinem/rust-cache@v2.
Workflow cache policies
.github/workflows/ci-python.yml, .github/workflows/ci-rust.yml
Caches Rust release artifacts under the release namespace and limits cache writes to refs/heads/master; removes the Python job’s prior sccache setup.

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

Possibly related PRs

  • ByteVeda/taskito#310: Updates workflow path filters related to changes in the setup-rust composite action.
🚥 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 matches the main CI caching change: replacing sccache cache usage to prevent GitHub Actions cache quota exhaustion.
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 fix/ci-cache-thrash

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

@pratyush618
pratyush618 merged commit f8676a9 into master Jul 19, 2026
32 checks passed
@pratyush618
pratyush618 deleted the fix/ci-cache-thrash branch July 19, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant