Skip to content

Commit ae12ee6

Browse files
committed
chore(CI): merge lint and testing
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 05e6d42 commit ae12ee6

File tree

3 files changed

+66
-64
lines changed

3 files changed

+66
-64
lines changed

.github/workflows/go.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Run Testing
2+
on: push
3+
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Setup go
9+
uses: actions/setup-go@v2
10+
with:
11+
go-version: '^1'
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
- name: Setup golangci-lint
15+
uses: golangci/golangci-lint-action@v2
16+
with:
17+
version: v1.44.0
18+
args: --verbose
19+
20+
# Label of the container job
21+
test:
22+
strategy:
23+
matrix:
24+
os: [ubuntu-latest]
25+
go: [1.13, 1.14, 1.15, 1.16, 1.17]
26+
include:
27+
- os: ubuntu-latest
28+
go-build: ~/.cache/go-build
29+
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
30+
runs-on: ${{ matrix.os }}
31+
env:
32+
GO111MODULE: on
33+
GOPROXY: https://proxy.golang.org
34+
35+
steps:
36+
- uses: vishnudxb/[email protected]
37+
with:
38+
master1-port: 6379
39+
slave1-port: 6380
40+
41+
- name: Set up Go ${{ matrix.go }}
42+
uses: actions/setup-go@v2
43+
with:
44+
go-version: ${{ matrix.go }}
45+
46+
- name: Checkout Code
47+
uses: actions/checkout@v2
48+
with:
49+
ref: ${{ github.ref }}
50+
51+
- uses: actions/cache@v2
52+
with:
53+
path: |
54+
${{ matrix.go-build }}
55+
~/go/pkg/mod
56+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-
59+
- name: Run Tests
60+
run: |
61+
go test -v -covermode=atomic -coverprofile=coverage.out
62+
63+
- name: Upload coverage to Codecov
64+
uses: codecov/codecov-action@v2
65+
with:
66+
flags: ${{ matrix.os }},go-${{ matrix.go }}

.github/workflows/lint.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/testing.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)