Skip to content

Commit

Permalink
build: get cache paths from go env (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker authored Sep 7, 2021
1 parent 1da2067 commit e223944
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ jobs:
uses: actions/setup-go@v2.1.4
with:
go-version: 1.17
- name: Restore Cache
uses: actions/cache@v2.1.6
- id: cache-paths
name: Get cache paths
run: |
echo "::set-output name=go-cache::$(go env GOCACHE)"
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
- uses: actions/cache@v2.1.6
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }}
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run test
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ jobs:
uses: actions/setup-go@v2.1.4
with:
go-version: 1.17
- name: Restore Cache
uses: actions/cache@v2.1.6
- id: cache-paths
name: Get cache paths
run: |
echo "::set-output name=go-cache::$(go env GOCACHE)"
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
- uses: actions/cache@v2.1.6
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }}
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run e2e
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ jobs:
uses: actions/setup-go@v2.1.4
with:
go-version: 1.17
- name: Restore Cache
uses: actions/cache@v2.1.6
- id: cache-paths
name: Get cache paths
run: |
echo "::set-output name=go-cache::$(go env GOCACHE)"
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
- uses: actions/cache@v2.1.6
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }}
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go generate ./...
Expand Down

0 comments on commit e223944

Please sign in to comment.