From a074c801d197860389934544943c0e8f1e4e37b0 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 6 Jan 2023 08:58:42 +0100 Subject: [PATCH] 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. --- .github/actions/setup-go/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 175cb78b5..f0d7b9abf 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -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