From 9eeb23104f2679a42945c845037ddb6b4d069d58 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sat, 25 Jan 2025 23:05:14 +0100 Subject: [PATCH] ci/macos: tweak ccache handling (#13141) Ensure the cache does not get removed after being stale when not bumping base for more than 7 days. --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ac55ed53..38ee959ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,14 +125,16 @@ jobs: path: build key: ${{ env.CACHE_KEY }}-build-${{ hashFiles('cache-key') }} - - name: Restore build cache + - name: Lookup or restore build cache id: ccache-restore - if: steps.build-restore.outputs.cache-hit != 'true' uses: actions/cache/restore@v4 with: path: /Users/runner/Library/Caches/ccache key: ${{ env.CACHE_KEY }}-ccache-${{ hashFiles('cache-key') }} restore-keys: ${{ env.CACHE_KEY }}-ccache- + # When not building, do a lookup so the cache + # does not get removed after 7 days with no use. + lookup-only: ${{ steps.build-restore.outputs.cache-hit }} - name: Install ccache if: steps.build-restore.outputs.cache-hit != 'true'