From 5a73383d709422d6db776623a849b2b9cd543ec9 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Tue, 19 Nov 2024 15:27:30 -0500 Subject: [PATCH] chore: Add Windows image version to cache key --- .github/actions/setup-go/action.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index bca65bda73b..2e0afaf0e3d 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -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 @@ -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