Selaa lähdekoodia

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
Ivan Savenko 2 kuukautta sitten
vanhempi
sitoutus
7bc3ba2b28
1 muutettua tiedostoa jossa 9 lisäystä ja 9 poistoa
  1. 9 9
      .github/workflows/github.yml

+ 9 - 9
.github/workflows/github.yml

@@ -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/[email protected]
       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/[email protected]
-      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