-
Notifications
You must be signed in to change notification settings - Fork 15
210 lines (179 loc) · 6.46 KB
/
ci-okbchain-ut.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: ci-okbchain-ut
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
app:
name: app ut
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Run Test okbchain/app
id: first-attempt
run: |
set -ex
codePath="./app/..."
go list ${codePath} |xargs go test -mod=readonly -timeout 8m -coverprofile=coverage.data -covermode=atomic
continue-on-error: true
- name: Run Test okbchain/app Retry on error
id: second-attempt
if: steps.first-attempt.outcome != 'success'
run: |
set -ex
codePath="./app/..."
go list ${codePath} |xargs go test -mod=readonly -timeout 8m -coverprofile=coverage.data -covermode=atomic
- name: Upload code coverage
run: |
set -ex
echo "mode: atomic" > coverage.txt
tail -n +2 coverage.data >> coverage.txt
bash <(curl -s https://codecov.io/bash) -f coverage.txt
x:
name: x ut
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Run Test okbchain/x
id: first-attempt
run: |
set -ex
codePath="./x/..."
go list ${codePath} |xargs go test -mod=readonly -timeout 8m -coverprofile=coverage.data -covermode=atomic
continue-on-error: true
- name: Run Test okbchain/x Retry
id: second-attempt
if: steps.first-attempt.outcome != 'success'
run: |
set -ex
codePath="./x/..."
go list ${codePath} |xargs go test -mod=readonly -timeout 8m -coverprofile=coverage.data -covermode=atomic
- name: Upload code coverage
run: |
set -ex
echo "mode: atomic" > coverage.txt
tail -n +2 coverage.data >> coverage.txt
bash <(curl -s https://codecov.io/bash) -f coverage.txt
libstm:
name: libs tm ut
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Go Test okbchain/libs/tm
id: first-attempt
run: |
set -ex
codePath="./libs/tendermint/..."
go list ${codePath} |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
continue-on-error: true
- name: Go Test okbchain/libs/tm retry
id: second-attempt
if: steps.first-attempt.outcome != 'success'
run: |
set -ex
codePath="./libs/tendermint/..."
go list ${codePath} |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
- name: Go Test okbchain/libs/ibc-go/testing
id: ibc-first-attempt
run: |
set -ex
codePath="./libs/ibc-go/..."
go list ${codePath} | grep -w "testing" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
continue-on-error: true
- name: Go Test okbchain/libs/ibc-go/testing retry
id: ibc-second-attempt
if: steps.ibc-first-attempt.outcome != 'success'
run: |
set -ex
codePath="./libs/ibc-go/..."
go list ${codePath} | grep -w "testing" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
libsibc:
name: libs ibc ut
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Go Test okbchain/libs/ibc-go
id: first-attempt
run: |
set -ex
codePath="./libs/ibc-go/..."
go list ${codePath} | grep -vw "testing" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
continue-on-error: true
- name: Go Test okbchain/libs/ibc-go retry
id: second-attempt
if: steps.first-attempt.outcome != 'success'
run: |
set -ex
codePath="./libs/ibc-go/..."
go list ${codePath} | grep -vw "testing" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
libscosmos:
name: libs cosmos ut
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Go Test okbchain/libs/cosmos-sdk/x
id: first-attempt
run: |
set -ex
codePath="./libs/cosmos-sdk/..."
go list ${codePath} | grep -w "x" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
continue-on-error: true
- name: Go Test okbchain/libs/cosmos-sdk/x retry
id: second-attempt
if: steps.first-attempt.outcome != 'success'
run: |
set -ex
codePath="./libs/cosmos-sdk/..."
go list ${codePath} | grep -w "x" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
libsother:
name: libs other ut
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.20"
- name: Go Test okbchain/libs/other
id: first-attempt
run: |
set -ex
codePath="./libs/..."
go list ${codePath} | grep -vw "cosmos-sdk" | grep -vw "ibc-go" | grep -vw "tendermint" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
continue-on-error: true
- name: Go Test okbchain/libs/other retry
id: second-attempt
if: steps.first-attempt.outcome != 'success'
run: |
set -ex
codePath="./libs/..."
go list ${codePath} | grep -vw "cosmos-sdk" | grep -vw "ibc-go" | grep -vw "tendermint" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
- name: Go Test okbchain/libs/cosmos-sdk/other
id: x-first-attempt
run: |
set -ex
codePath="./libs/cosmos-sdk/..."
go list ${codePath} | grep -wv "x" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'
continue-on-error: true
- name: Go Test okbchain/libs/cosmos-sdk/other retry
id: x-second-attempt
if: steps.x-first-attempt.outcome != 'success'
run: |
set -ex
codePath="./libs/cosmos-sdk/..."
go list ${codePath} | grep -wv "x" |xargs go test -timeout 10m -tags='norace ledger test_ledger_mock'