CI: split ccache into restore/save so cache persists on failure

Use separate cache/restore and cache/save steps with if: always()
on the save step, matching the build_all_targets pattern.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche 2026-02-09 14:12:44 -08:00
parent e831c66ae1
commit 8a007d38e7

View File

@ -27,9 +27,9 @@ jobs:
- name: Git ownership workaround
run: git config --system --add safe.directory '*'
- name: ccache cache
- name: ccache cache restore
id: cc_restore
uses: runs-on/cache@v4
uses: runs-on/cache/restore@v4
with:
path: ~/.ccache
key: ccache-clang-tidy-${{ github.ref_name }}
@ -56,3 +56,10 @@ jobs:
- name: ccache post-build stats
if: always()
run: ccache -s
- name: ccache cache save
if: always()
uses: runs-on/cache/save@v4
with:
path: ~/.ccache
key: ${{ steps.cc_restore.outputs.cache-primary-key }}