Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Cache Go Modules in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmeuli committed Apr 28, 2020
1 parent 95fc03b commit 774d4f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,14 @@ jobs:
with:
go-version: 1.14

- name: Restore Go Modules cache
id: go-mod-cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod/
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Lint
run: docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.24.0 golangci-lint run
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ jobs:
with:
go-version: 1.14

- name: Restore Go Modules cache
id: go-mod-cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod/
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@ jobs:
with:
go-version: 1.14

- name: Restore Go Modules cache
id: go-mod-cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod/
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Run tests
run: go test

0 comments on commit 774d4f3

Please sign in to comment.