From 699bb3b786407e1ff112fe31d0933ed66aceddf4 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 4 Jun 2022 10:49:49 +0200 Subject: [PATCH] Fix ccache saving on cache hit When a cache with the key exists it is NOT saved even when changed. Hence make the key unique to a commit (SHA) and restore the most recent cache with a key prefixed by the part without the SHA. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3c9eb0..f60c626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,8 @@ jobs: if: env.B2_USE_CCACHE with: path: ~/.ccache - key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}} + key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}} + restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}- - name: Fetch Boost.CI uses: actions/checkout@v3