forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
230 lines (217 loc) · 6.05 KB
/
config.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
version: 2.1
executors:
golang:
docker:
- image: circleci/golang:1.13
docs:
docker:
- image: tendermintdev/docker-website-deployment
environment:
AWS_REGION: us-east-1
commands:
make:
parameters:
description:
type: string
target:
type: string
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
name: "Restore source code cache"
keys:
- go-src-v1-{{ .Revision }}
- checkout
- restore_cache:
name: "Restore go modules cache"
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: << parameters.description >>
command: |
make << parameters.target >>
jobs:
build-docs:
executor: docs
steps:
- checkout
- run:
name: "Build docs"
command: make build-docs
- run:
name: "Upload docs to S3"
command: make sync-docs
setup-dependencies:
executor: golang
steps:
- checkout
- restore_cache:
name: "Restore go modules cache"
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: Cache go modules
command: make go-mod-cache
- run:
name: Build
command: make build
- run:
name: Git garbage collection
command: git gc
- save_cache:
name: "Save go modules cache"
key: go-mod-v2-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- save_cache:
name: "Save source code cache"
key: go-src-v1-{{ .Revision }}
paths:
- ".git"
test-sim-nondeterminism:
executor: golang
steps:
- make:
target: test-sim-nondeterminism
description: "Test individual module simulations"
test-sim-import-export:
executor: golang
steps:
- make:
target: test-sim-import-export
description: "Test application import/export simulation"
test-sim-after-import:
executor: golang
steps:
- make:
target: test-sim-after-import
description: "Test simulation after import"
test-sim-multi-seed-long:
executor: golang
steps:
- make:
target: test-sim-multi-seed-long
description: "Test multi-seed simulation (long)"
test-sim-multi-seed-short:
executor: golang
steps:
- make:
target: test-sim-multi-seed-short
description: "Test multi-seed simulation (short)"
test-cover:
executor: golang
parallelism: 4
steps:
- checkout
- restore_cache:
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: Run tests
command: |
export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')"
export GO111MODULE=on
mkdir -p /tmp/logs /tmp/workspace/profiles
for pkg in $(go list ./... | grep -v '/simulation' | circleci tests split); do
id=$(echo "$pkg" | sed 's|[/.]|_|g')
go test -mod=readonly -timeout 8m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
done
- persist_to_workspace:
root: /tmp/workspace
paths:
- "profiles/*"
- store_artifacts:
path: /tmp/logs
upload-coverage:
executor: golang
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: gather
command: |
echo "--> Concatenating profiles:"
ls /tmp/workspace/profiles/
echo "mode: atomic" > coverage.txt
for prof in $(ls /tmp/workspace/profiles/); do
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
done
- run:
name: filter out DONTCOVER
command: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
- run:
name: upload
command: bash <(curl -s https://codecov.io/bash) -f coverage.txt
update-swagger-docs:
executor: golang
steps:
- make:
target: update-swagger-docs
description: "Check if statik.go is up-to-date"
workflows:
version: 2
test-suite:
jobs:
- update-swagger-docs:
requires:
- setup-dependencies
- setup-dependencies:
# This filter enables the job for tags
filters:
tags:
only:
- /^v.*/
- test-sim-nondeterminism:
requires:
- setup-dependencies
- test-sim-import-export:
requires:
- setup-dependencies
- test-sim-after-import:
requires:
- setup-dependencies
- test-sim-multi-seed-short:
requires:
- setup-dependencies
- test-sim-multi-seed-long:
requires:
- setup-dependencies
# These filters ensure that the long sim only runs during release
filters:
branches:
ignore: /.*/
tags:
only:
- /^v.*/
- test-cover:
requires:
- setup-dependencies
- upload-coverage:
requires:
- test-cover
- build-docs:
context: docs-deployment-master
filters:
branches:
only:
- /.*/
tags:
ignore:
- /^v.*/
- build-docs:
context: docs-deployment-release
filters:
branches:
ignore:
- /.*/
tags:
only:
- /v.*/