forked from reviewdog/reviewdog
-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (30 loc) · 862 Bytes
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Go
on: [push,pull_request]
jobs:
test:
permissions:
contents: read
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/checkout@v3
with:
fetch-depth: 50 # Need git history for testing.
# https://github.com/actions/cache/blob/master/examples.md#go---modules
- name: Cache Go Modules
id: cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go Modules
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download
- name: Test
run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./...
- uses: codecov/codecov-action@v3