-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (90 loc) · 2.39 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Continuous Integration
on:
workflow_dispatch:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
paths-ignore:
- '**.md'
- '.gitignore'
env:
GO111MODULE: on
GONOSUMDB: "*"
GOSUMDB: off
jobs:
CommitLint:
name: commit lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Run commitlint
uses: wagoid/commitlint-github-action@v5
StaticCheck:
name: "static check"
needs: CommitLint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: WillAbides/[email protected]
with:
go-version: "1.19"
- name: Run static check
run: make static-check
OtherGoLint:
name: "style check, go vet and other go lint"
needs: CommitLint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: WillAbides/[email protected]
with:
go-version: "1.18"
- name: Run go version check
run: make go-version-check
- name: Run style check
run: make style-check
- name: Run go vet check
run: make go-vet-check
# - name: Run golangci-lint ## TODO: use github-action below
# run: make golangci-lint-check
- name: Run golangci-lint
uses: golangci/[email protected]
with:
version: v1.47.3
# args: --timeout=10m --tests=false --skip-dirs=open_src
args: --timeout=10m
only-new-issues: true
skip-pkg-cache: true
skip-build-cache: true
UT:
name: unit test
if: github.event.pull_request.draft == false
needs: [StaticCheck, OtherGoLint]
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"] # "macOS-latest"
go: ["1.18.x", "1.20.x"]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: WillAbides/[email protected]
with:
go-version: ${{ matrix.go }}
- name: Run gotest
run: |
go mod tidy
make gotest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3