Skip to content

ci: skip cache save on self-hosted runners - #2

Merged
goastler merged 1 commit into
mainfrom
ci/skip-cache-save-on-self-hosted
Aug 12, 2026
Merged

ci: skip cache save on self-hosted runners#2
goastler merged 1 commit into
mainfrom
ci/skip-cache-save-on-self-hosted

Conversation

@goastler

Copy link
Copy Markdown
Member

restore_npm_cache and restore_cargo_cache already skip on self-hosted (runner.environment != 'self-hosted', opt back in via an input). The matching save_* actions had no such gate, so a self-hosted job still uploaded the whole cache over the WAN and then ran the gh cache delete cleanup.

That asymmetry is worse than plain waste: the cleanup keeps only the newest npm-<os>-<arch>- / cargo-… key, so a cache produced on self-hosted hardware displaces the ones GitHub-hosted runners restore from.

Both actions now take save-on-self-hosted (default "false"), matching the shape of the restore inputs.

Related, not fixed here: the cached paths include .turbo and .nx, which live inside the workspace. actions/checkout runs git clean -ffdx when reusing a checkout, so on a persistent runner those are wiped every job — skipping restore there means turbo starts cold every run. The fix is to relocate those cache dirs under $HOME rather than to re-enable the upload; tracked separately.

@goastler
goastler marked this pull request as ready for review August 12, 2026 07:04
@goastler
goastler enabled auto-merge August 12, 2026 07:23
@goastler
goastler force-pushed the ci/skip-cache-save-on-self-hosted branch from 0c84818 to 3a546ef Compare August 12, 2026 07:25
@goastler
goastler merged commit 4a2e0a1 into main Aug 12, 2026
1 check passed
@goastler
goastler deleted the ci/skip-cache-save-on-self-hosted branch August 12, 2026 07:25
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