ci: don't save caches for pull requests

This commit is contained in:
tobtoht
2026-05-25 19:27:19 +02:00
parent 8fd42c3baf
commit 816cc806e9
3 changed files with 82 additions and 15 deletions
+19 -7
View File
@@ -104,21 +104,21 @@ jobs:
fetch-depth: 0
submodules: recursive
# Most volatile cache
- name: ccache
uses: actions/cache@v5
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: ~/.cache/ccache
key: ccache-${{ matrix.toolchain.host }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.toolchain.host }}-
# Less volatile cache
- name: depends cache
uses: actions/cache@v5
- name: restore depends cache
uses: actions/cache/restore@v5
id: depends-restore
with:
path: contrib/depends/built
key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
restore-keys: |
depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
depends-${{ matrix.toolchain.host }}-
restore-keys: depends-${{ matrix.toolchain.host }}-
- name: prepare w64-mingw32
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' }}
run: |
@@ -129,6 +129,18 @@ jobs:
run: |
${{env.CCACHE_SETTINGS}}
make depends target=${{ matrix.toolchain.host }} -j${{env.MAKE_JOB_COUNT}}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
- name: save depends cache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.depends-restore.outputs.cache-hit != 'true'
with:
path: contrib/depends/built
key: ${{ steps.depends-restore.outputs.cache-primary-key }}
- uses: actions/upload-artifact@v7
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'x86_64-apple-darwin' || matrix.toolchain.host == 'arm64-apple-darwin' || matrix.toolchain.host == 'x86_64-unknown-linux-gnu' }}
with: