Skip to content

Commit

Permalink
go: enable module and build caching (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker authored Feb 24, 2021
1 parent c52742d commit cd199b7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ jobs:
uses: actions/setup-go@v2.1.3
with:
go-version: 1.15
- name: Restore Cache
uses: actions/cache@v2.1.3
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make test
- name: Run build
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/generated_code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,16 @@ jobs:
uses: actions/setup-go@v2.1.3
with:
go-version: 1.15
- name: Restore Cache
uses: actions/cache@v2.1.3
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: go generate and diff checks
run: go generate ./... && git diff --exit-code
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ jobs:
uses: actions/setup-go@v2.1.3
with:
go-version: 1.15
- name: Restore Cache
uses: actions/cache@v2.1.3
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run GoReleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit cd199b7

Please sign in to comment.