Skip to content

Commit cd199b7

Browse files
authored
go: enable module and build caching (#71)
1 parent c52742d commit cd199b7

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ jobs:
2424
uses: actions/[email protected]
2525
with:
2626
go-version: 1.15
27+
- name: Restore Cache
28+
uses: actions/[email protected]
29+
with:
30+
path: |-
31+
~/go/pkg/mod
32+
~/.cache/go-build
33+
~/Library/Caches/go-build
34+
%LocalAppData%\go-build
35+
key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-
2738
- name: Run tests
2839
run: make test
2940
- name: Run build

.github/workflows/generated_code_checks.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,16 @@ jobs:
1414
uses: actions/[email protected]
1515
with:
1616
go-version: 1.15
17+
- name: Restore Cache
18+
uses: actions/[email protected]
19+
with:
20+
path: |-
21+
~/go/pkg/mod
22+
~/.cache/go-build
23+
~/Library/Caches/go-build
24+
%LocalAppData%\go-build
25+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
26+
restore-keys: |
27+
${{ runner.os }}-go-
1728
- name: go generate and diff checks
1829
run: go generate ./... && git diff --exit-code

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ jobs:
1717
uses: actions/[email protected]
1818
with:
1919
go-version: 1.15
20+
- name: Restore Cache
21+
uses: actions/[email protected]
22+
with:
23+
path: |-
24+
~/go/pkg/mod
25+
~/.cache/go-build
26+
~/Library/Caches/go-build
27+
%LocalAppData%\go-build
28+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
2031
- name: Run GoReleaser
2132
env:
2233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)