-
Notifications
You must be signed in to change notification settings - Fork 255
106 lines (95 loc) · 2.62 KB
/
build.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
94
95
96
97
98
99
100
101
102
103
104
105
name: build
on: [push,pull_request]
jobs:
check_fmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Intsall Golangci-lint
run: |
# add executables installed with go get to PATH
# TODO: this will hopefully be fixed by
# https://github.com/actions/setup-go/issues/14
export PATH=${PATH}:`go env GOPATH`/bin
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install mvdan.cc/sh/cmd/shfmt@latest
go install mvdan.cc/sh/cmd/gosh@latest
- name: Lint
run: |
bash findlargefile.sh
make checkgofmt && make fmt_go
make linter
unit-test:
name: unit-test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: unit-test
run: |
sudo sysctl -w net.core.rmem_max=2500000
make test
coverage:
name: coverage
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: ut coverage
run: |
sudo sysctl -w net.core.rmem_max=2500000
make coverage
- name: cover report
if: success()
run: bash <(curl -s https://codecov.io/bash)
deploy:
name: deploy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: deploy
run: |
make build_ci
make autotest dapp=all
make docker-compose && make docker-compose-down
test-goarch-386:
name: Run test cases with GOARCH=386
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Build
run: make build
env:
GOARCH: 386
- name: Run test in 386
run: go test ./... -covermode=atomic
env:
GOARCH: 386