diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f93e1b8fa..4fa4a11d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: - name: Restore vcpkg dependency cache uses: actions/cache/restore@v4 + id: cacheRestoreVcpkg with: path: vcpkg_installed key: vcpkgCache-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }} @@ -45,9 +46,10 @@ jobs: - name: Save vcpkg dependency cache uses: actions/cache/save@v4 + if: steps.cacheRestoreVcpkg.outputs.cache-hit == 'false' with: path: vcpkg_installed - key: vcpkgCache-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }} + key: ${{ steps.cacheRestoreVcpkg.outputs.cache-primary-key }} - name: Copy vcpkg cache to NAS2D folder run: | @@ -71,6 +73,7 @@ jobs: - name: Restore NAS2D cache uses: actions/cache/restore@v4 + id: cacheRestoreNas2d with: path: nas2d-core/.build/ key: nas2dCache-${{ runner.os }}-${{ matrix.platform }}-${{ env.nas2dSha }} @@ -84,12 +87,14 @@ jobs: - name: Save build cache - NAS2D uses: actions/cache/save@v4 + if: steps.cacheRestoreNas2d.outputs.cache-hit == 'false' with: path: nas2d-core/.build/ - key: nas2dCache-${{ runner.os }}-${{ matrix.platform }}-${{ env.nas2dSha }} + key: ${{ steps.cacheRestoreNas2d.outputs.cache-primary-key }} - name: Restore incremental build cache uses: actions/cache/restore@v4 + id: cacheRestoreOphd if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) with: path: .build @@ -134,6 +139,7 @@ jobs: - name: Save incremental build cache - OPHD uses: actions/cache/save@v4 + if: steps.cacheRestoreOphd.outcome == 'skipped' || steps.cacheRestoreOphd.outputs.cache-hit == 'false' with: path: .build key: buildCache-${{ runner.os }}-${{ matrix.platform }}-${{ github.sha }}