From 61806bb9c41cb2f2c25b79149ea51381239915a1 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 29 May 2025 13:37:48 +0200 Subject: [PATCH] Remove old caches --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3107b0ea..397b632e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,10 @@ on: - "true" - "false" +permissions: + contents: read + actions: write + concurrency: group: ${{ github.ref }} cancel-in-progress: true @@ -118,6 +122,19 @@ 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 }} @@ -322,6 +339,17 @@ 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 }}