Skip to content

Commit

Permalink
Automatically create a new cache whenever the dependencies change
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeage committed Dec 10, 2023
1 parent 6ab2cd6 commit 670a0f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 670a0f9

Please sign in to comment.