Skip to content

Commit 2155942

Browse files
authored
chore: upgrade golangci-lint to v1.42.0 and add cache (#22)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent 890e62d commit 2155942

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/workflows/go.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,34 @@ on:
99
- master
1010

1111
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
1226
test:
1327
strategy:
1428
matrix:
1529
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
1736
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
1837
runs-on: ${{ matrix.os }}
1938
env:
2039
GO111MODULE: on
21-
TESTTAGS: ${{ matrix.test-tags }}
2240
GOPROXY: https://proxy.golang.org
2341
steps:
2442
- name: Set up Go ${{ matrix.go }}
@@ -31,14 +49,19 @@ jobs:
3149
with:
3250
ref: ${{ github.ref }}
3351

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-
3760
- name: Run Tests
3861
run: |
39-
go install github.com/campoy/embedmd@latest
40-
embedmd -d *.md
4162
go test -v -covermode=atomic -coverprofile=coverage.out
4263
4364
- 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

Comments
 (0)