Fix ccache action:

- use distinct cache names for all platform to avoid name clash on Linux
and Android (which shared preset between configurations)
- use branch name as cache key so beta/develop cache is kept separate
This commit is contained in:
Ivan Savenko
2025-08-05 17:37:44 +03:00
parent 396470d962
commit 7bc3ba2b28
+9 -9
View File
@@ -25,13 +25,13 @@ jobs:
before_install: linux_qt6.sh
preset: linux-clang-test
- platform: linux
- platform: linux-qt5
os: ubuntu-24.04
test: 1
before_install: linux_qt5.sh
preset: linux-gcc-test
- platform: linux
- platform: linux-debug
os: ubuntu-22.04
test: 0
before_install: linux_qt5.sh
@@ -189,21 +189,21 @@ jobs:
uses: hendrikmuhs/ccache-action@v1.2
if: ${{ github.event.number != '' && !startsWith(matrix.platform, 'msvc') }}
with:
key: ${{ matrix.preset }}-PR-${{ github.event.number }}
key: ${{ matrix.platform }}-PR-${{ github.event.number }}
restore-keys: |
${{ matrix.preset }}-PR-${{ github.event.number }}
${{ matrix.preset }}-no-PR
${{ matrix.platform }}-PR-${{ github.event.number }}
${{ matrix.platform }}-branch-${{ github.base_ref }}
# actual cache takes up less space, at most ~1 GB
max-size: "5G"
verbose: 2
- name: ccache for everything but PRs
- name: ccache for branch builds
uses: hendrikmuhs/ccache-action@v1.2
if: ${{ (!startsWith(matrix.platform, 'msvc')) && (github.repository == 'vcmi/vcmi' && github.event.number == '' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master')) || github.repository != 'vcmi/vcmi' }}
if: ${{ github.event.number == '' && !startsWith(matrix.platform, 'msvc')}}
with:
key: ${{ matrix.preset }}-no-PR
key: ${{ matrix.platform }}-${{ github.ref_name }}
restore-keys: |
${{ matrix.preset }}-no-PR
${{ matrix.platform }}-branch-${{ github.ref_name }}
# actual cache takes up less space, at most ~1 GB
max-size: "5G"
verbose: 2