-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fixed caching workflow
- Loading branch information
Phillip Miller
committed
Dec 29, 2021
1 parent
7124b9a
commit c32060b
Showing
3 changed files
with
83 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,18 +22,24 @@ jobs: | |
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache Go modules | ||
- id: go-cache-paths | ||
run: | | ||
echo "::set-output name=go-build::$(go env GOCACHE)" | ||
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | ||
# Cache go build cache | ||
- name: Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
|
||
# Cache go mod cache | ||
- name: Go Mod Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build-${{ env.cache-name }}- | ||
${{ runner.OS }}-build- | ||
${{ runner.OS }}- | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Install dependencies | ||
run: go get github.com/mattn/[email protected] | ||
|
@@ -58,18 +64,24 @@ jobs: | |
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache Go modules | ||
- id: go-cache-paths | ||
run: | | ||
echo "::set-output name=go-build::$(go env GOCACHE)" | ||
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | ||
# Cache go build cache | ||
- name: Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
|
||
# Cache go mod cache | ||
- name: Go Mod Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
key: ${{ runner.os }}-test-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-test-${{ env.cache-name }}- | ||
${{ runner.OS }}-test- | ||
${{ runner.OS }}- | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Install dependencies | ||
run: go get github.com/mattn/[email protected] | ||
|
@@ -104,18 +116,24 @@ jobs: | |
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache Go modules | ||
- id: go-cache-paths | ||
run: | | ||
echo "::set-output name=go-build::$(go env GOCACHE)" | ||
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | ||
# Cache go build cache | ||
- name: Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
|
||
# Cache go mod cache | ||
- name: Go Mod Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
key: ${{ runner.os }}-run-pimp-my-shell-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-run-pimp-my-shell-${{ env.cache-name }}- | ||
${{ runner.OS }}-run-pimp-my-shell- | ||
${{ runner.OS }}- | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Go Build | ||
run: | | ||
|
@@ -176,17 +194,24 @@ jobs: | |
with: | ||
go-version: 1.17.x | ||
|
||
- name: Cache Go modules | ||
- id: go-cache-paths | ||
run: | | ||
echo "::set-output name=go-build::$(go env GOCACHE)" | ||
echo "::set-output name=go-mod::$(go env GOMODCACHE)" | ||
# Cache go build cache | ||
- name: Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
|
||
# Cache go mod cache | ||
- name: Go Mod Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-release-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-release-${{ env.cache-name }}- | ||
${{ runner.OS }}-release- | ||
${{ runner.OS }}- | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Install dependencies | ||
run: go get github.com/mattn/[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