From 202461c5bdddacfb092fcdc7c38abbb24613f263 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 29 May 2025 13:46:59 +0200 Subject: [PATCH] Update caches --- .github/workflows/build.yml | 50 +++++++++++++++---------------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 397b632e..9cbc2a24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,12 +99,13 @@ jobs: echo "SCCACHE_CACHE_SIZE=300M" >> $GITHUB_ENV - name: Recover sccache - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ${{env.SCCACHE_DIR}} - key: sccache dumper ${{ github.head_ref || github.ref_name }} + key: sccache-dumper-${{ github.head_ref || github.ref_name }}- restore-keys: | - sccache dumper ${{ github.event.repository.default_branch }} + sccache-dumper-${{ github.event.repository.default_branch }}- + sccache dumper ${{ github.head_ref || github.ref_name }}- - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.9 @@ -114,6 +115,12 @@ jobs: - name: CMake Build run: cmake --preset=release && cmake --build --preset=release -t dump-apiset + - name: Save sccache + uses: actions/cache/save@v3 + with: + path: ${{env.SCCACHE_DIR}} + key: sccache-dumper-${{ github.head_ref || github.ref_name }}-${{github.run_id}}-${{github.run_attempt}} + - name: Upload Artifacts uses: pyTooling/upload-artifact@v4 with: @@ -122,19 +129,6 @@ jobs: path: "*" retention-days: 1 - - - name: Remove old cache - uses: actions/github-script@v7.0.1 - continue-on-error: true - with: - script: | - github.rest.actions.deleteActionsCacheByKey({ - owner: context.repo.owner, - repo: context.repo.repo, - key: "sccache dumper ${{ github.head_ref || github.ref_name }}", - }).catch(e => {}) - - create-emulation-root: name: Create Emulation Root runs-on: ${{ matrix.runner }} @@ -302,12 +296,13 @@ jobs: echo "SCCACHE_CACHE_SIZE=300M" >> $GITHUB_ENV - name: Recover sccache - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: ${{env.SCCACHE_DIR}} - key: sccache ${{matrix.platform}} ${{matrix.configuration}} ${{ github.head_ref || github.ref_name }} + key: sccache-${{matrix.platform}}-${{matrix.configuration}}-${{ github.head_ref || github.ref_name }}- restore-keys: | - sccache ${{matrix.platform}} ${{matrix.configuration}} ${{ github.event.repository.default_branch }} + sccache-${{matrix.platform}}-${{matrix.configuration}}-${{ github.event.repository.default_branch }}- + sccache ${{matrix.platform}} ${{matrix.configuration}} ${{ github.head_ref || github.ref_name }}- - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.9 @@ -324,6 +319,12 @@ jobs: - name: CMake Build run: cmake --preset=${{matrix.preset}} ${{matrix.cmake-options}} && cmake --build --preset=${{matrix.preset}} + - name: Save sccache + uses: actions/cache/save@v3 + with: + path: ${{env.SCCACHE_DIR}} + key: sccache ${{matrix.platform}} ${{matrix.configuration}} ${{ github.head_ref || github.ref_name }}-${{github.run_id}}-${{github.run_attempt}} + - name: Upload Artifacts uses: pyTooling/upload-artifact@v4 with: @@ -339,17 +340,6 @@ jobs: path: "build/${{matrix.preset}}/**/CTestTestfile.cmake" retention-days: 1 - - name: Remove old cache - uses: actions/github-script@v7.0.1 - continue-on-error: true - with: - script: | - github.rest.actions.deleteActionsCacheByKey({ - owner: context.repo.owner, - repo: context.repo.repo, - key: "sccache ${{matrix.platform}} ${{matrix.configuration}} ${{ github.head_ref || github.ref_name }}", - }).catch(e => {}) - test: name: Test runs-on: ${{ matrix.runner }}