diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml index eb88a4a57fc..ac8d17704c4 100644 --- a/.github/workflows/CI-mingw.yml +++ b/.github/workflows/CI-mingw.yml @@ -52,6 +52,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Build cppcheck run: | diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 94174689caa..7719fdb24a3 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -69,6 +69,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ matrix.image }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Run CMake run: | @@ -117,6 +119,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ matrix.image }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} # /usr/lib/ccache/bin - Alpine Linux diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index b739e008c26..b2031d5fab2 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -38,6 +38,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software on ubuntu if: contains(matrix.os, 'ubuntu') @@ -92,6 +94,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} # TODO: move latest compiler to separate step # TODO: bail out on warnings with latest GCC @@ -222,6 +226,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.cxxstd }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software on ubuntu if: contains(matrix.os, 'ubuntu') @@ -270,6 +276,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} # coreutils contains "nproc" - name: Install missing software on macos @@ -304,6 +312,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} # coreutils contains "nproc" - name: Install missing software on macos @@ -366,6 +376,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Run CMake on macOS (force Boost) run: | @@ -466,6 +478,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software on ubuntu if: contains(matrix.os, 'ubuntu') @@ -716,6 +730,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software on ubuntu run: | diff --git a/.github/workflows/corpus.yml b/.github/workflows/corpus.yml index d462222b268..71592bb8733 100644 --- a/.github/workflows/corpus.yml +++ b/.github/workflows/corpus.yml @@ -24,6 +24,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ runner.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software on ubuntu run: | diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fd3b5063049..95791148741 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,6 +29,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ runner.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software on ubuntu run: | diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index f7a0aa75201..5f11d80d847 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -58,6 +58,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.sanitizer }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Set up Python uses: actions/setup-python@v6 diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml index 35efc35ca1b..d01915c6ea6 100644 --- a/.github/workflows/scriptcheck.yml +++ b/.github/workflows/scriptcheck.yml @@ -29,6 +29,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ runner.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Cache Cppcheck uses: actions/cache@v5 diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml index 77d6d1bc483..26d83c2f406 100644 --- a/.github/workflows/selfcheck.yml +++ b/.github/workflows/selfcheck.yml @@ -32,6 +32,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ runner.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software run: | diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 44f762030c3..ca5180e1687 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -29,6 +29,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.24 with: key: ${{ github.workflow }}-${{ runner.os }} + # only save cache in main/release branches, PRs restore the cache of the base branch + save: ${{ github.event_name != 'pull_request' }} - name: Install missing software run: |