From 138b8a79d554a6f98e58f0c3b080612d3feda2e7 Mon Sep 17 00:00:00 2001 From: Daniel Kotik Date: Fri, 31 May 2024 22:38:27 +0200 Subject: [PATCH] Restrict usage of cache to PRs: Usage of the cache should speed up *multiple* workflow runs within PRs for fixing failed tests etc. So far even for pushes to `develop` and `master` branches (merge commit of PRs) the Docker image is also uploaded to the cache, but most likely won't get used afterwards and hence only occupies cached storage. --- .github/workflows/cpu-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpu-tests.yml b/.github/workflows/cpu-tests.yml index 531fb0c7c..50c152bbb 100644 --- a/.github/workflows/cpu-tests.yml +++ b/.github/workflows/cpu-tests.yml @@ -42,6 +42,7 @@ jobs: - name: Restore cache uses: actions/cache@v3 id: cache-docker + if: github.event_name == 'pull_request' with: path: ${{ env.DOCKER_CACHE_PATH }} key: ${{ github.run_id }}