-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fixup all go setups with manual cache keys (#960)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it actions/setup-go#358 #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Allows atomic build caches per job that actually dont overwrite each other Co-authored-by: Hilmar Falkenberg <[email protected]>
- Loading branch information
1 parent
dd2e6ba
commit b6ed713
Showing
9 changed files
with
261 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,24 @@ jobs: | |
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: '${{ github.workspace }}/go.mod' | ||
cache: false | ||
|
||
- name: Get go environment for use with cache | ||
run: | | ||
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV | ||
echo "go_modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV | ||
- name: Set up cache | ||
# https://github.com/actions/setup-go/issues/358 - cache is not working with setup-go for multiple jobs | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ env.go_cache }} | ||
${{ env.go_modcache }} | ||
key: ${{ env.cache_name }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/go.mod') }} | ||
restore-keys: | | ||
${{ env.cache_name }}-${{ runner.os }}-go- | ||
env: | ||
cache_name: mend-scan-go-cache | ||
|
||
- name: 'Setup jq' | ||
uses: dcarbone/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters