Repository navigation
Restrict ccache archive saves to main - #33941
Merged
Merged
Conversation
Keep restores available on all refs and save cache misses only after successful jobs on refs/heads/main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the cache-publishing changes.
No open issues 🎉
What changed in this PR
Restricts legacy ccache archive publishing to successful main runs while preserving cache restores for PRs and other branches. This leaves the separate macOS sccache work unchanged.
Changes:
- Splits 13 combined cache actions into pinned restore and explicit save steps.
- Allows saves only on
refs/heads/mainwhen the job succeeds and no exact cache hit exists. - Places saves last while preserving existing cache keys, paths, and build/test behavior.
| File | Description |
|---|---|
.github/workflows/reusable_linux_build.yml |
Separates restore and main-only save in the reusable Linux job. |
.github/workflows/linux-wasm-ci-build-and-test-workflow.yml |
Applies the save policy to the reusable WASM job, preserving web cache keys. |
.github/workflows/linux_minimal_build.yml |
Applies restore/save separation across nine build jobs. |
.github/workflows/android.yml |
Adds final, main-only cache saves to both Android jobs. |
Review effort: Balanced
Edward Chen (edgchen1)
previously approved these changes
Nov 6, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Edward Chen (edgchen1)
approved these changes
Nov 6, 2026
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.
Description
Split the 13 combined ccache cache actions into pinned
actions/cache/restoreand explicitactions/cache/savesteps across:.github/workflows/linux_minimal_build.yml(9 jobs).github/workflows/android.yml(2 jobs).github/workflows/linux-wasm-ci-build-and-test-workflow.yml(1 reusable job, including the web cache keys).github/workflows/reusable_linux_build.yml(1 reusable job)Restores remain enabled on all previously supported runs. Publishing is restricted to successful jobs on the exact
refs/heads/mainref when there was no exact cache hit. Save steps run last, after tests, artifacts, and cleanup, rather than immediately after compilation. Existing cache keys, paths, action pins, permissions, triggers, and build/test behavior are preserved. No additional token permissions are required.Validation (Windows, actionlint 1.7.12;
$checksis the session-local verification tools directory; verification scripts are not repository changes):python "$checks\validate_ccache.py" --candidate origin/mainpython "$checks\validate_ccache.py"python "$checks\validate_actionlint.py"origin/main(14 custom-runner-label diagnostics and the WASM top-leveldescriptionerror); no new diagnostics.git diff --checkThe following actionlint command also passed, excluding only the baseline-confirmed diagnostic messages. Shellcheck and pyflakes were not run:
Full compiler builds were not run for this workflow-only change. No CI runs were manually triggered and no live caches were deleted.
Motivation and Context
Temporarily stop PR and non-main runs from publishing additional legacy ccache archives while retaining their ability to restore existing caches. The combined cache action otherwise automatically publishes a cache miss after a successful PR job.
Existing cache entries remain until separately cleaned up or evicted. This does not disable local ccache writes, redesign keys, change sccache/vcpkg behavior, or modify the merged #33811 branch.