refactor(ci): consolidate all compilation caching to sccache#328
Merged
DorianZheng merged 1 commit intomainfrom Mar 2, 2026
Merged
refactor(ci): consolidate all compilation caching to sccache#328DorianZheng merged 1 commit intomainfrom
DorianZheng merged 1 commit intomainfrom
Conversation
Remove Swatinem/rust-cache from all workflows and standardize on sccache as the sole compilation cache. sccache caches individual compilation units via the GHA cache API, which works both on host runners and inside Docker/manylinux containers — unlike Swatinem which only caches host-level target/ directories. Changes: - Remove Swatinem/rust-cache from build-runtime, build-wheels, build-node, and test workflows - Extend sccache to macOS (previously Linux-only) by removing platform conditions from sccache setup and GHA env export steps - Add sccache to clippy (lint.yml) and cli/go test jobs (test.yml) - Skip sccache for rust test job (cargo-llvm-cov conflicts via RUSTC_WRAPPER) - Add CARGO_INCREMENTAL=0 everywhere (required for sccache) - Chain build-runtime after warm-caches via workflow_run trigger - Fix build-wheels Export step: remove explicit SCCACHE_GHA_ENABLED and RUSTC_WRAPPER (let sccache-action set them on success only) - Update README.md with new architecture diagram and cache docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflow_runtrigger so builds benefit from warm cacheSCCACHE_GHA_ENABLED/RUSTC_WRAPPERfrom Export step to prevent macOS failures when sccache-action fails withcontinue-on-errorWhy
Two caching systems (Swatinem + sccache) created redundancy:
Trade-off: Cargo dependencies are re-downloaded each run (~30-60s) since Swatinem cached
~/.cargo, but compilation (5-20 min) is the real bottleneck that sccache addresses.Test plan
test.ymlandlint.yml— verify sccache stats in cli, go, and clippy jobsworkflow_dispatchonbuild-runtime.yml— verify macOS sccache stats appearworkflow_runrusttest job (llvm-cov) works without sccache (no RUSTC_WRAPPER conflict)rust-cache-*entries should stop being created