From 848b0ecccbc5cbe8035fa282836d7e4b6fa77469 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Fri, 27 Jun 2025 08:52:27 +0300 Subject: [PATCH] Fix GitHub actions cache handling Fix the CCache cache path. The default in modern CCache is ~/.cache/ccache. Use `github.run_id` for cache key timestamp. Previous timestamp generation emitted a warning about `set-output` being deprecated. --- .github/workflows/build.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e919b123..997f1c2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,19 +99,11 @@ jobs: - name: Install build dependencies run: sudo apt-get install -y libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev ccache - # See https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/ - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - name: Configure ccache uses: actions/cache@v4 with: - path: ~/.ccache - key: ${{ matrix.config.os }}-${{ matrix.config.CC }}-${{ matrix.config.version }}-${{ matrix.config.type }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + path: ~/.cache/ccache + key: ${{ matrix.config.os }}-${{ matrix.config.CC }}-${{ matrix.config.version }}-${{ matrix.config.type }}-ccache-${{ github.run_id }} restore-keys: ${{ matrix.config.os }}-${{ matrix.config.CC }}-${{ matrix.config.version }}-${{ matrix.config.type }}-ccache- - name: Create Build Environment @@ -157,7 +149,10 @@ jobs: shell: bash run: | make -j3 VERBOSE=1 - ccache -s + + - name: Show ccache statistics + run: | + ccache --show-stats --verbose - name: Test working-directory: ${{runner.workspace}}/build