Skip to content

Commit

Permalink
chore: Add Windows image version to cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
KapJI committed Nov 20, 2024
1 parent 3d6026f commit 5a73383
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ runs:
echo "GOMODCACHE=D:\\golang\\modcache" >> $GITHUB_ENV
echo "GOPATH=D:\\golang\\go" >> $GITHUB_ENV
echo "USERPROFILE=D:\\homedir" >> $GITHUB_ENV
echo "OS_EXTRA_VERSION=${ImageVersion}-v2-" >> $GITHUB_ENV
elif [ "$RUNNER_OS" = "macOS" ]; then
echo "GOCACHE=/Users/runner/go/pkg/mod" >> $GITHUB_ENV
echo "GOMODCACHE=/Users/runner/Library/Caches/go-build" >> $GITHUB_ENV
Expand All @@ -36,18 +37,18 @@ runs:
path: |
${{ env.GOCACHE }}
${{ env.GOMODCACHE }}
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }}
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ env.OS_EXTRA_VERSION }}${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ env.OS_EXTRA_VERSION }}
- uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a
if: ${{ inputs.upload-cache != 'true' }}
with:
path: |
${{ env.GOCACHE }}
${{ env.GOMODCACHE }}
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ hashFiles('**/go.sum') }}
key: ${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ env.OS_EXTRA_VERSION }}${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-
${{ inputs.cache-prefix }}-${{ runner.os }}-${{ runner.arch }}-go-${{ inputs.go-version }}-${{ env.OS_EXTRA_VERSION }}
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
Expand Down

0 comments on commit 5a73383

Please sign in to comment.