diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea0c9b91a9..6b913ff8e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -372,7 +372,10 @@ jobs: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10 with: path: Library/PackageCache - key: Library_PackageCache_${{ env.UNITY_VERSION }} + key: Library_PackageCache_${{ env.UNITY_VERSION }}_${{ hashFiles('Packages/packages-lock.json') }} + restore-keys: | + Library_PackageCache_${{ env.UNITY_VERSION }} + Library_PackageCache - name: Set output filename env: @@ -504,7 +507,7 @@ jobs: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10 with: path: Library/PackageCache - key: Library_PackageCache_${{ env.UNITY_VERSION }} + key: Library_PackageCache_${{ env.UNITY_VERSION }}_${{ hashFiles('Packages/packages-lock.json') }} - name: Clean Library before caching if: github.ref == 'refs/heads/main' && steps.cache_library.outputs.cache-hit != 'true' # Ideally, we'd save caches on branches, but they're too big, and branch caches can evict those from main, which is unacceptable.