Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02c7be3

Browse files
authored
chore(ci) : cache go-build folders (google#2054)
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent c3073c8 commit 02c7be3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# is very little in the library that is platform specific
2222
- go-version: 1.x
2323
platform: windows-latest
24-
24+
2525
# only update test coverage stats with the most recent go version on linux
2626
- go-version: 1.x
2727
platform: ubuntu-latest
@@ -38,11 +38,19 @@ jobs:
3838
with:
3939
go-version: ${{ matrix.go-version }}
4040
- uses: actions/checkout@v2
41-
41+
42+
# Get values for cache paths to be used in later steps
43+
- id: cache-paths
44+
run: |
45+
echo "::set-output name=go-cache::$(go env GOCACHE)"
46+
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
47+
4248
- name: Cache go modules
4349
uses: actions/cache@v2
4450
with:
45-
path: ~/go/pkg/mod
51+
path: |
52+
${{ steps.cache-paths.outputs.go-cache }}
53+
${{ steps.cache-paths.outputs.go-mod-cache }}
4654
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
4755
restore-keys: ${{ runner.os }}-go-
4856

0 commit comments

Comments
 (0)