|
|
|
@ -27,6 +27,17 @@ jobs: |
|
|
|
|
- name: Check out code into the Go module directory |
|
|
|
|
uses: actions/checkout@v2 |
|
|
|
|
|
|
|
|
|
- name: Cache dependencies |
|
|
|
|
uses: actions/cache@v2 |
|
|
|
|
with: |
|
|
|
|
# Cache |
|
|
|
|
path: ~/go/pkg/mod |
|
|
|
|
# Cache key |
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
|
|
|
|
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key |
|
|
|
|
restore-keys: | |
|
|
|
|
${{ runner.os }}-go- |
|
|
|
|
|
|
|
|
|
- name: Get dependencies |
|
|
|
|
run: | |
|
|
|
|
go get -v -t -d ./... |
|
|
|
@ -48,8 +59,13 @@ jobs: |
|
|
|
|
|
|
|
|
|
- name: Build |
|
|
|
|
run: go build ./... |
|
|
|
|
|
|
|
|
|
- name: Test |
|
|
|
|
run: go test ./... |
|
|
|
|
run: go test ./... -coverprofile=coverage.txt -covermode=atomic |
|
|
|
|
|
|
|
|
|
- name: Coverage |
|
|
|
|
run: bash <(curl -s https://codecov.io/bash) |
|
|
|
|
|
|
|
|
|
- name: Tool |
|
|
|
|
run: | |
|
|
|
|
go install ./... |
|
|
|
|