Skip to content

Replace deprecated save-always with cache/restore + cache/save#8891

Open
tautschnig wants to merge 5 commits into
diffblue:developfrom
tautschnig:ci-save-restore
Open

Replace deprecated save-always with cache/restore + cache/save#8891
tautschnig wants to merge 5 commits into
diffblue:developfrom
tautschnig:ci-save-restore

Conversation

@tautschnig
Copy link
Copy Markdown
Collaborator

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.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig self-assigned this Mar 25, 2026
@tautschnig tautschnig requested review from a team and peterschrammel as code owners March 25, 2026 13:34
Copilot AI review requested due to automatic review settings March 25, 2026 13:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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@v5 steps that used save-always: true with actions/cache/restore@v5 restore steps.
  • Added corresponding actions/cache/save@v5 steps 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-keys is written as an indented block without | (multiline string) or - (YAML list). In YAML this gets parsed as a single folded scalar, so actions/cache/restore will effectively receive one restore-key instead of the intended two. Use a restore-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-keys is written as an indented block without | (multiline string) or - (YAML list). In YAML this gets parsed as a single folded scalar, so actions/cache/restore will effectively receive one restore-key instead of the intended two. Use a restore-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-keys is written as an indented block without | (multiline string) or - (YAML list). In YAML this gets parsed as a single folded scalar, so actions/cache/restore will effectively receive one restore-key instead of the intended two. Use a restore-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
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.56%. Comparing base (808dae2) to head (6168492).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

tautschnig and others added 5 commits May 25, 2026 19:36
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>
@tautschnig tautschnig requested a review from kroening as a code owner May 25, 2026 19:47
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.

4 participants