Skip to content

Commit

Permalink
Add cache to build GitHub action
Browse files Browse the repository at this point in the history
Add cache step to save Go modules between runs.
  • Loading branch information
HeavyWombat committed Apr 8, 2021
1 parent 147770f commit d6cbdd6
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Setup Cache for Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Tools
run: |
pushd "$(mktemp -d)"
go get github.com/gordonklaus/ineffassign
go get golang.org/x/lint/golint
go get github.com/client9/misspell/cmd/misspell
go get honnef.co/go/tools/cmd/staticcheck
go get github.com/onsi/ginkgo/ginkgo github.com/onsi/gomega/...
popd
- name: Verify Go Modules Setup
run: |
go mod verify
Expand All @@ -38,27 +56,22 @@ jobs:
- name: Sanity Check (ineffassign)
run: |
go get github.com/gordonklaus/ineffassign
ineffassign ./...
- name: Sanity Check (golint)
run: |
go get golang.org/x/lint/golint
golint ./...
- name: Sanity Check (misspell)
run: |
go get github.com/client9/misspell/cmd/misspell
find . -type f | xargs misspell -source=text -error
- name: Sanity Check (staticcheck)
run: |
go get honnef.co/go/tools/cmd/staticcheck
staticcheck ./...
- name: Run Go Unit Tests
run: |
go get github.com/onsi/ginkgo/ginkgo github.com/onsi/gomega/...
ginkgo -r -randomizeAllSpecs -randomizeSuites -failOnPending -nodes=4 -compilers=2 -race -trace -cover
- name: Upload Code Coverage Profile
Expand Down

0 comments on commit d6cbdd6

Please sign in to comment.