9
9
- master
10
10
11
11
jobs :
12
+ lint :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Setup go
16
+ uses : actions/setup-go@v2
17
+ with :
18
+ go-version : ' ^1.16'
19
+ - name : Checkout repository
20
+ uses : actions/checkout@v2
21
+ - name : Setup golangci-lint
22
+ uses : golangci/golangci-lint-action@v2
23
+ with :
24
+ version : v1.41.1
25
+ args : --verbose
12
26
test :
13
27
strategy :
14
28
matrix :
15
29
os : [ubuntu-latest]
16
- go : [1.13, 1.14, 1.15, 1.16]
30
+ go : [1.13, 1.14, 1.15, 1.16, 1.17]
31
+ include :
32
+ - os : ubuntu-latest
33
+ go-build : ~/.cache/go-build
34
+ - os : macos-latest
35
+ go-build : ~/Library/Caches/go-build
17
36
name : ${{ matrix.os }} @ Go ${{ matrix.go }}
18
37
runs-on : ${{ matrix.os }}
19
-
20
38
env :
21
39
GO111MODULE : on
22
40
TESTTAGS : ${{ matrix.test-tags }}
@@ -32,14 +50,19 @@ jobs:
32
50
with :
33
51
ref : ${{ github.ref }}
34
52
35
- - name : golangci-lint
36
- uses : golangci/golangci-lint-action@v2
53
+ - uses : actions/cache@v2
37
54
with :
38
- version : v1.41.1
39
-
55
+ path : |
56
+ ${{ matrix.go-build }}
57
+ ~/go/pkg/mod
58
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
59
+ restore-keys : |
60
+ ${{ runner.os }}-go-
40
61
- name : Run Tests
41
62
run : |
42
- go test -v -covermode=atomic -coverprofile=coverage.out ./...
63
+ go test -v -covermode=atomic -coverprofile=coverage.out
43
64
44
65
- name : Upload coverage to Codecov
45
- uses : codecov/codecov-action@v1
66
+ uses : codecov/codecov-action@v2
67
+ with :
68
+ flags : ${{ matrix.os }},go-${{ matrix.go }},${{ matrix.test-tags }}
0 commit comments