Replace deprecated save-always with cache/restore + cache/save#8891
Replace deprecated save-always with cache/restore + cache/save#8891tautschnig wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates CI workflows to remove usage of the deprecated actions/cache@v5 save-always: true input by switching to the recommended actions/cache/restore@v5 + actions/cache/save@v5 (guarded with if: always()) pattern.
Changes:
- Replaced
actions/cache@v5steps that usedsave-always: truewithactions/cache/restore@v5restore steps. - Added corresponding
actions/cache/save@v5steps at the end of each affected job to ensure caches are saved even when the job fails.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/release-packages.yaml | Switch ccache caching to restore/save split for release packaging jobs (Linux + Windows). |
| .github/workflows/pull-request-checks.yaml | Switch ccache caching to restore/save split across the main PR CI matrix jobs. |
| .github/workflows/pull-request-check-rust-api.yaml | Switch ccache caching to restore/save split for Rust API PR checks. |
| .github/workflows/csmith.yaml | Switch ccache caching to restore/save split for Csmith workflow. |
| .github/workflows/coverage.yaml | Switch ccache caching to restore/save split for coverage workflow. |
| .github/workflows/build-and-test-Xen.yaml | Switch ccache caching to restore/save split for Xen build/test workflow. |
| .github/workflows/build-and-test-Linux.yaml | Switch ccache caching to restore/save split for Linux build/test workflow. |
| .github/workflows/bsd.yaml | Switch ccache caching to restore/save split for BSD workflows. |
Comments suppressed due to low confidence (3)
.github/workflows/release-packages.yaml:36
restore-keysis written as an indented block without|(multiline string) or-(YAML list). In YAML this gets parsed as a single folded scalar, soactions/cache/restorewill effectively receive one restore-key instead of the intended two. Use arestore-keys: |block (or a proper YAML sequence) so each prefix is a separate restore key.
restore-keys:
${{ runner.os }}-24.04-Release-${{ github.ref }}
${{ runner.os }}-24.04-Release
.github/workflows/release-packages.yaml:108
restore-keysis written as an indented block without|(multiline string) or-(YAML list). In YAML this gets parsed as a single folded scalar, soactions/cache/restorewill effectively receive one restore-key instead of the intended two. Use arestore-keys: |block (or a proper YAML sequence) so each prefix is a separate restore key.
restore-keys:
${{ runner.os }}-24.04-Arm-Release-${{ github.ref }}
${{ runner.os }}-24.04-Arm-Release
.github/workflows/release-packages.yaml:180
restore-keysis written as an indented block without|(multiline string) or-(YAML list). In YAML this gets parsed as a single folded scalar, soactions/cache/restorewill effectively receive one restore-key instead of the intended two. Use arestore-keys: |block (or a proper YAML sequence) so each prefix is a separate restore key.
restore-keys:
${{ runner.os }}-22.04-Release-${{ github.ref }}
${{ runner.os }}-22.04-Release
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8891 +/- ##
========================================
Coverage 80.55% 80.56%
========================================
Files 1707 1707
Lines 189051 189051
Branches 73 73
========================================
+ Hits 152299 152302 +3
+ Misses 36752 36749 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The actions/cache save-always input has been deprecated and will be removed in a future release. Replace all occurrences of actions/cache@v5 with save-always: true by a pair of actions/cache/restore@v5 (to restore) and actions/cache/save@v5 (with if: always(), to unconditionally save) steps. This follows the pattern established in the profiling workflow and the recommendation at https://github.com/actions/cache/tree/main/save#always-save-cache. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
The missing `|` would render the intended set of keys a single, folded scalar, likely resulting in never managing to match those keys.
The FreeBSD and OpenBSD jobs in this file have a blank line between the last commented-out line of the Build and Test 'run:' block and the new 'Save ccache' step. The NetBSD job did not, because the diff hunk that introduced the save step landed flush against the closing line of its 'run:' block. Add the matching blank line so all three jobs are formatted identically. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
When the deprecated 'actions/cache@v5' with 'save-always: true' was split into a 'cache/restore' step and a matching 'cache/save' step, the save step's 'key:' became a literal duplicate of the restore step's 'key:'. With 31 such pairs across nine workflow files (the eight files modified by the previous commit, plus profiling.yaml which already used the split pattern), any future edit to a cache key requires touching two lines per job and is easy to get wrong. Give every restore step the id 'restore-ccache' and reference its 'cache-primary-key' output from the matching save step, so the key only needs to be written once per job. This is the pattern recommended by the actions/cache documentation. Step IDs are job-scoped, so re-using the same id across jobs is safe. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
Three jobs in pull-request-checks.yaml previously saved their ccache
under the identical key
'${{ runner.os }}-24.04-Release-${{ github.ref }}-${{ github.sha }}-PR':
- check-ubuntu-24_04-cmake-gcc
- check-ubuntu-24_04-cmake-gcc-KNOWNBUG
- check-ubuntu-24_04-cmake-gcc-THOROUGH
Under the implicit save semantics of 'actions/cache@v5' the collision
was silently resolved (whichever of the three jobs finished first won
the cache write); after switching to 'actions/cache/save@v5' the
losers log a 'Failed to save: Unable to reserve cache with key …'
warning. Beyond the noise, the three jobs were also racing to compile
the same translation units with no shared cache hits within a single
workflow run.
Make 'check-ubuntu-24_04-cmake-gcc' the sole producer of this cache
lineage:
- 'check-ubuntu-24_04-cmake-gcc-KNOWNBUG' and
'check-ubuntu-24_04-cmake-gcc-THOROUGH' now declare
'needs: check-ubuntu-24_04-cmake-gcc' so they start only after
the producer's 'Save ccache' has run.
- Their own 'Save ccache' steps (and the now-unused 'id:' on the
matching restore steps) are removed.
- The KNOWNBUG cmake invocation gains '-Dsat_impl="minisat2;cadical"'
so its compile commands hash identically to the producer's. Without
this, every translation unit that depends on which SAT backends are
enabled (most of src/solvers/) would miss the hot cache.
Net effect: a single deterministic ccache producer per workflow run,
no collision warnings, and KNOWNBUG/THOROUGH benefit from a same-run
hot cache rather than only a previous run's warm cache.
Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
c3fd391 to
6168492
Compare
The actions/cache save-always input has been deprecated and will be removed in a future release. Replace all occurrences of actions/cache@v5 with save-always: true by a pair of actions/cache/restore@v5 (to restore) and actions/cache/save@v5 (with if: always(), to unconditionally save) steps.
This follows the pattern established in the profiling workflow and the recommendation at
https://github.com/actions/cache/tree/main/save#always-save-cache.