-
Notifications
You must be signed in to change notification settings - Fork 114
127 lines (115 loc) · 3.08 KB
/
Copy pathbuild.yml
File metadata and controls
127 lines (115 loc) · 3.08 KB
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
120
121
122
123
124
125
126
127
name: ci_base
on: [push,pull_request]
jobs:
check_fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- 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
echo $GOPATH
echo $PATH
go install golang.org/x/tools/cmd/goimports@v0.24.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
go install mvdan.cc/sh/v3/cmd/shfmt@v3.7.0
go install mvdan.cc/sh/v3/cmd/gosh@v3.7.0
- name: Lint
run: |
make largefile-check
# make checkgofmt && make fmt_go
# make linter
make
unit-test:
name: unit-test
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: Set up Golang
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
id: go
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: unit-test
run: make test
coverage:
name: coverage
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Golang
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
id: go
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: ut coverage
run: make coverage
- name: cover report
if: success()
run: bash <(curl -s https://codecov.io/bash)
autotest:
name: autotest
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Golang
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
id: go
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: deploy
run: |
make build_ci
make autotest dapp=all
ci_base:
name: ci_base
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Golang
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
id: go
- name: set go env
run: export PATH=${PATH}:`go env GOPATH`/bin
- name: deploy
run: |
make docker-compose
make docker-compose-down
test-arch-386:
name: Test GOARCH 386
runs-on: ubuntu-22.04
env:
GOARCH: 386
CGO_ENABLED: 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- run: |
sudo apt-get update
sudo apt-get install --fix-missing gcc-multilib
- name: Build
run: make build
- name: Run unit tests
run: go test ./... -covermode=atomic