diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10dc3d84e..fe34475c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,6 +55,7 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.18 with: key: ${{ runner.os }}-ubuntu-${{ matrix.container_version }} + evict-old-files: 'job' - name: Build PythonQt run: | @@ -214,6 +215,7 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.18 with: key: ${{ runner.os }}-${{ matrix.qt-version }} + evict-old-files: 'job' - name: Detect exact versions id : versions diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml index 6770f4d8f..4ba5f854b 100644 --- a/.github/workflows/build_latest.yml +++ b/.github/workflows/build_latest.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu', 'windows'] - qt-version: [ '5.12.*', '5.15.*', '6.8.*', '6.9.*' ] + qt-version: [ '5.12.*', '5.15.*', '6.9.*' ] python-version: [ '3.12' ] runs-on: ${{ matrix.os }}-latest steps: @@ -50,6 +50,7 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2.18 with: key: ${{ runner.os }}-${{ matrix.qt-version }} + evict-old-files: 'job' if: ${{ matrix.os == 'ubuntu' }} - name: Set environment diff --git a/.github/workflows/clean_caches.yml b/.github/workflows/clean_caches.yml new file mode 100644 index 000000000..348e81af3 --- /dev/null +++ b/.github/workflows/clean_caches.yml @@ -0,0 +1,30 @@ +name: Cleanup caches on closed pull requests +on: + pull_request: + types: + - closed + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + actions: write + contens: read + steps: + - name: Cleanup caches + run: | + echo "Fetching list of cache keys" + cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id') + + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + gh cache delete $cacheKey + done + echo "Done" + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge