Skip to content

Commit 72e527a

Browse files
joseph-isaacsclaude
andcommitted
perf(ci): skip rust-cache when S3 sccache is configured
The Swatinem/rust-cache was caching ~10GB and taking 3+ minutes to extract on runs-on self-hosted runners. Since these runners already have S3-backed sccache configured via runs-on/action, the rust-cache was redundant. This change automatically detects when S3 sccache is configured by checking for the SCCACHE_BUCKET environment variable (set by runs-on/action when sccache: s3 is used). When detected, rust-cache is skipped. Jobs on ubuntu-latest without S3 sccache still benefit from rust-cache. Expected improvement: ~3 minutes faster setup-rust on runs-on runners. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Joe Isaacs <[email protected]>
1 parent fec90ce commit 72e527a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/actions/setup-rust/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ runs:
3737
targets: "${{inputs.targets || ''}}"
3838
components: "${{ inputs.components || 'clippy, rustfmt' }}"
3939

40+
# Skip rust-cache when S3 sccache is already configured (detected via SCCACHE_BUCKET env).
41+
# The rust-cache was ~10GB and took 3+ minutes to extract, while sccache
42+
# S3 backend already provides efficient compile caching.
4043
- name: Rust Dependency Cache
44+
if: ${{ !env.SCCACHE_BUCKET }}
4145
uses: Swatinem/rust-cache@v2
4246
with:
4347
save-if: ${{ github.ref_name == 'develop' }}
44-
shared-key: "rust-cache-${{ runner.os }}-${{ runner.environment }}" # To allow reuse across jobs
48+
shared-key: "rust-cache-${{ runner.os }}-${{ runner.environment }}"
4549

4650
- name: Rust Compile Cache
4751
uses: mozilla-actions/[email protected]

0 commit comments

Comments
 (0)