diff --git a/.github/workflows/ResInsightMac.yml b/.github/workflows/ResInsightMac.yml index 4a1f7b3c05..1bd1d3996d 100644 --- a/.github/workflows/ResInsightMac.yml +++ b/.github/workflows/ResInsightMac.yml @@ -127,8 +127,9 @@ jobs: with: path: ${{ env.BUILDCACHE_DIR }} key: ${{ runner.os }}-${{ matrix.arch }}-appleclang-6.7.0-buildcache-v01-${{ steps.current-time.outputs.formattedTime }} - restore-keys: | - ${{ runner.os }}-${{ matrix.arch }}-appleclang-6.7.0-buildcache-v01- + # The nightly scheduled run starts from an empty cache and saves a + # freshly built one; other runs restore the latest nightly cache. + restore-keys: ${{ github.event_name != 'schedule' && format('{0}-{1}-appleclang-6.7.0-buildcache-v01-', runner.os, matrix.arch) || '' }} - name: Create folder for buildcache run: mkdir -p "${{ env.BUILDCACHE_DIR }}" diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index 7627fe44c8..c39d912df9 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -142,6 +142,9 @@ jobs: run: echo "timestamp ${{ steps.current-time.outputs.formattedTime }}" - name: Restore Buildcache + # The nightly scheduled run starts from an empty cache and saves a + # freshly built one; all other runs restore the latest nightly cache. + if: github.event_name != 'schedule' id: cache-buildcache uses: actions/cache/restore@v6 with: