-
Notifications
You must be signed in to change notification settings - Fork 6
119 lines (105 loc) · 2.83 KB
/
ci.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: ci
on:
push:
branches:
- main
pull_request:
env:
GO_VERSION: "1.20"
PYTHON_VERSION: 3.9
GRPC_HEALTH_PROBE_VERSION: v0.4.13
jobs:
gomod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Install tools
run: |
make tools
- name: Check go mod
run: |
make mod-tidy-check
make mod-vendor-check
- name: Check proto
run: |
make proto-check
- name: Check generate
run: |
make generate-check
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.6.0
with:
version: latest
skip-cache: true
skip-pkg-cache: true
build:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
run: make build
test:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Coverage test
run: |
pip install pytest
pip install pytest-cov
make test_coverage TEST_FLAGS='-race -failfast -count=1 -timeout=20m'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out,./coverage.xml
fail_ci_if_error: true
verbose: true
e2e_test:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Install grpc_health_probe
run: |
wget -qO${PWD}/bin/grpc-health-probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${{ env.GRPC_HEALTH_PROBE_VERSION }}/grpc_health_probe-linux-amd64
chmod +x ${PWD}/bin/grpc-health-probe
echo "${PWD}/bin" >> $GITHUB_PATH
- name: Test
run: |
whereis grpc-health-probe
make test_e2e_local TEST_FLAGS='-race -failfast -count=1 -timeout=20m'