GitHub: add job ID to cache key
To avoid the problem where multiple jobs try to create the same cache entry, we add the GitHub job ID to the cache key. The two restore keys make it possible that a job can also restore a cache entry from another job if none for the current job exist yet.
This commit is contained in:
1 file changed
+2
-1
@@ -27,8 +27,9 @@ runs:
|
||||
~/.cache/go-build
|
||||
~/Library/Caches/go-build
|
||||
~\AppData\Local\go-build
|
||||
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||
key: ${{ runner.os }}-go-${{ inputs.go-version }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-${{ inputs.go-version }}-${{ github.job }}-
|
||||
${{ runner.os }}-go-${{ inputs.go-version }}-
|
||||
|
||||
- name: set GOPATH
|
||||
|
||||
Reference in new issue
Block a user