Skip to content

Commit d2b56b8

Browse files
authored
chore(CI): add go1.7 and cache library (#31)
* chore(CI): add go1.7 and cache library Signed-off-by: Bo-Yi Wu <[email protected]> * chore: remove support macos Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent e9e5da1 commit d2b56b8

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,14 +9,32 @@ 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.41.1
25+
args: --verbose
1226
test:
1327
strategy:
1428
matrix:
1529
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
1736
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
1837
runs-on: ${{ matrix.os }}
19-
2038
env:
2139
GO111MODULE: on
2240
TESTTAGS: ${{ matrix.test-tags }}
@@ -32,14 +50,19 @@ jobs:
3250
with:
3351
ref: ${{ github.ref }}
3452

35-
- name: golangci-lint
36-
uses: golangci/golangci-lint-action@v2
53+
- uses: actions/cache@v2
3754
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-
4061
- name: Run Tests
4162
run: |
42-
go test -v -covermode=atomic -coverprofile=coverage.out ./...
63+
go test -v -covermode=atomic -coverprofile=coverage.out
4364
4465
- 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

Comments
 (0)