|
38 | 38 | uses: hendrikmuhs/ccache-action@v1.2.24 |
39 | 39 | with: |
40 | 40 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 41 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 42 | + save: ${{ github.event_name != 'pull_request' }} |
41 | 43 |
|
42 | 44 | - name: Install missing software on ubuntu |
43 | 45 | if: contains(matrix.os, 'ubuntu') |
|
92 | 94 | uses: hendrikmuhs/ccache-action@v1.2.24 |
93 | 95 | with: |
94 | 96 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 97 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 98 | + save: ${{ github.event_name != 'pull_request' }} |
95 | 99 |
|
96 | 100 | # TODO: move latest compiler to separate step |
97 | 101 | # TODO: bail out on warnings with latest GCC |
@@ -222,6 +226,8 @@ jobs: |
222 | 226 | uses: hendrikmuhs/ccache-action@v1.2.24 |
223 | 227 | with: |
224 | 228 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.cxxstd }} |
| 229 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 230 | + save: ${{ github.event_name != 'pull_request' }} |
225 | 231 |
|
226 | 232 | - name: Install missing software on ubuntu |
227 | 233 | if: contains(matrix.os, 'ubuntu') |
@@ -270,6 +276,8 @@ jobs: |
270 | 276 | uses: hendrikmuhs/ccache-action@v1.2.24 |
271 | 277 | with: |
272 | 278 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 279 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 280 | + save: ${{ github.event_name != 'pull_request' }} |
273 | 281 |
|
274 | 282 | # coreutils contains "nproc" |
275 | 283 | - name: Install missing software on macos |
@@ -304,6 +312,8 @@ jobs: |
304 | 312 | uses: hendrikmuhs/ccache-action@v1.2.24 |
305 | 313 | with: |
306 | 314 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 315 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 316 | + save: ${{ github.event_name != 'pull_request' }} |
307 | 317 |
|
308 | 318 | # coreutils contains "nproc" |
309 | 319 | - name: Install missing software on macos |
@@ -366,6 +376,8 @@ jobs: |
366 | 376 | uses: hendrikmuhs/ccache-action@v1.2.24 |
367 | 377 | with: |
368 | 378 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 379 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 380 | + save: ${{ github.event_name != 'pull_request' }} |
369 | 381 |
|
370 | 382 | - name: Run CMake on macOS (force Boost) |
371 | 383 | run: | |
@@ -466,6 +478,8 @@ jobs: |
466 | 478 | uses: hendrikmuhs/ccache-action@v1.2.24 |
467 | 479 | with: |
468 | 480 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 481 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 482 | + save: ${{ github.event_name != 'pull_request' }} |
469 | 483 |
|
470 | 484 | - name: Install missing software on ubuntu |
471 | 485 | if: contains(matrix.os, 'ubuntu') |
@@ -716,6 +730,8 @@ jobs: |
716 | 730 | uses: hendrikmuhs/ccache-action@v1.2.24 |
717 | 731 | with: |
718 | 732 | key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} |
| 733 | + # only save cache in main/release branches, PRs restore the cache of the base branch |
| 734 | + save: ${{ github.event_name != 'pull_request' }} |
719 | 735 |
|
720 | 736 | - name: Install missing software on ubuntu |
721 | 737 | run: | |
|
0 commit comments