-
Notifications
You must be signed in to change notification settings - Fork 12
64 lines (62 loc) · 1.49 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: build
on:
# Run this workflow every time a new commit pushed to upstream/fork repository.
# Run workflow on fork repository will help contributors find and resolve issues before sending a PR.
push:
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: lint
run: hack/verify-staticcheck.sh
- name: import alias
run: hack/verify-import-aliases.sh
fmt:
name: gofmt
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: go fmt check
run: make fmt-check
vet:
name: go vet
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: go vet
run: make vet
test:
name: unit test
needs:
- fmt
- vet
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- name: Run coverage
run: ./script/test.sh
- name: Codecov
uses: codecov/[email protected]