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.42.0
25
+ args : --verbose
12
26
test :
13
27
strategy :
14
28
matrix :
15
29
os : [ubuntu-latest, macos-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
38
env :
20
39
GO111MODULE : on
21
- TESTTAGS : ${{ matrix.test-tags }}
22
40
GOPROXY : https://proxy.golang.org
23
41
steps :
24
42
- name : Set up Go ${{ matrix.go }}
@@ -31,14 +49,19 @@ jobs:
31
49
with :
32
50
ref : ${{ github.ref }}
33
51
34
- - name : golangci-lint
35
- uses : golangci/golangci-lint-action@v2
36
-
52
+ - uses : actions/cache@v2
53
+ with :
54
+ path : |
55
+ ${{ matrix.go-build }}
56
+ ~/go/pkg/mod
57
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
58
+ restore-keys : |
59
+ ${{ runner.os }}-go-
37
60
- name : Run Tests
38
61
run : |
39
- go install github.com/campoy/embedmd@latest
40
- embedmd -d *.md
41
62
go test -v -covermode=atomic -coverprofile=coverage.out
42
63
43
64
- name : Upload coverage to Codecov
44
- uses : codecov/codecov-action@v1
65
+ uses : codecov/codecov-action@v2
66
+ with :
67
+ flags : ${{ matrix.os }},go-${{ matrix.go }}
0 commit comments