Skip to content

Commit 258818c

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

File tree

3 files changed

+69
-66
lines changed

3 files changed

+69
-66
lines changed

.github/workflows/go.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
# Service containers to run with `container-job`
36+
services:
37+
nsqd:
38+
image: appleboy/nsqd
39+
ports:
40+
- 4150:4150
41+
- 4151:4151
42+
43+
steps:
44+
- name: Set up Go ${{ matrix.go }}
45+
uses: actions/setup-go@v2
46+
with:
47+
go-version: ${{ matrix.go }}
48+
49+
- name: Checkout Code
50+
uses: actions/checkout@v2
51+
with:
52+
ref: ${{ github.ref }}
53+
54+
- uses: actions/cache@v2
55+
with:
56+
path: |
57+
${{ matrix.go-build }}
58+
~/go/pkg/mod
59+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
60+
restore-keys: |
61+
${{ runner.os }}-go-
62+
- name: Run Tests
63+
run: |
64+
go test -v -covermode=atomic -coverprofile=coverage.out
65+
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@v2
68+
with:
69+
flags: ${{ matrix.os }},go-${{ matrix.go }}

.github/workflows/lint.yml

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

.github/workflows/testing.yml

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

0 commit comments

Comments
 (0)