-
Notifications
You must be signed in to change notification settings - Fork 25
/
.gitlab-ci.yml
306 lines (280 loc) · 7.28 KB
/
.gitlab-ci.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
include:
- project: TankerHQ/gitlab-ci-files
file: /common.yml
ref: 2023-08-25-271
- project: TankerHQ/gitlab-ci-files
file: /cache.yml
ref: 2023-12-12-275
variables:
GIT_DEPTH: 1
stages:
- check
- bridge-check
- bench
- deploy
default:
image: registry.gitlab.com/tankerhq/docker/node:latest
before_script:
- poetry -V
- node -v
- npm --version
- npm config list -l | grep cache
- poetry install --sync
- poetry run python --version
check/lint:
stage: check
extends:
- .npm-cache
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
- !reference [.rules/nightly, rules]
script:
- poetry run black --check run-ci.py
- poetry run flake8 run-ci.py
- poetry run mypy
- poetry run isort --profile black --check --diff run-ci.py
- poetry run python run-ci.py lint
tags: !reference [.tags/linux, tags]
check/linux/chrome:
stage: check
extends:
- .npm-cache
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
script:
- poetry run python run-ci.py check --runner linux
tags: !reference [.tags/linux, tags]
.check/linux/node-base:
stage: check
extends:
- .npm-cache
script:
- /usr/local/nvm/nvm-exec poetry run python run-ci.py check --runner node
- mv coverage/lcov-report lcov-report
artifacts:
expire_in: 7 days
paths:
- lcov-report/ # For manual download of coverage reports (artifacts.zip)
reports:
coverage_report: # For display of full coverage reports in MR diffs
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
coverage: '/^Statements\s*:\s*([^%]+)/' # For display of summary coverage % in pipeline/MR titles
tags: !reference [.tags/linux, tags]
check/linux/node:
extends:
- .check/linux/node-base
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
- !reference [.rules/nightly, rules]
variables:
NODE_VERSION: 18
check/linux/node/20:
extends:
- .check/linux/node-base
rules:
- !reference [.rules/push-master, rules]
- !reference [.rules/mr/manual, rules]
- !reference [.rules/nightly, rules]
variables:
NODE_VERSION: 20
check/macos:
stage: check
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
script:
- poetry run python run-ci.py check --runner macos
tags:
- macos
check/macos/nightly:
stage: check
extends: .rules/nightly
script:
- poetry run python run-ci.py check --runner macos --nightly
tags:
- macos
timeout: 3h
check/windows/edge:
stage: check
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
- !reference [.rules/nightly, rules]
script:
- poetry run python run-ci.py check --runner windows-edge
tags: !reference [.tags/windows, tags]
check/linux/nightly:
extends:
- .npm-cache
- .rules/nightly
stage: check
script:
- poetry run python run-ci.py check --runner linux --nightly
tags: !reference [.tags/linux, tags]
check/test-matcher:
stage: check
rules:
- !reference [.rules/push-master, rules]
- !reference [.rules/mr/manual, rules]
- !reference [.rules/nightly, rules]
script:
- /usr/local/nvm/nvm-exec poetry run python run-ci.py test-matcher
artifacts:
expire_in: 7 days
paths:
- functional_test_list.json
tags: !reference [.tags/linux, tags]
variables: !reference [check/linux/node, variables]
check/bridge-dotenv:
stage: check
inherit:
default: false
before_script:
- poetry install --sync
script:
- poetry run python run-ci.py write-bridge-dotenv --downstream benchmarks --downstream compatibility-tests
rules: # Other jobs cannot "needs" this once if the rules don't match
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
- !reference [.rules/nightly, rules]
artifacts:
expire_in: 7 days
reports:
dotenv: bridge.env
tags: !reference [.tags/linux, tags]
.bench/common:
extends: .variables/bridge-common
stage: bench
needs:
- check/bridge-dotenv
variables:
UPSTREAM_MERGE_REQUEST_IID: $CI_MERGE_REQUEST_IID
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
UPSTREAM_COMMIT_REF_NAME: $CI_COMMIT_REF_NAME
trigger:
project: TankerHQ/benchmarks
branch: $BENCHMARKS_BRIDGE_BRANCH
strategy: depend
.rules/bench:
rules:
- !reference [.rules/mr/manual, rules]
bench/linux:
extends:
- .bench/common
- .rules/bench
variables:
UPSTREAM_JOB_TARGET: linux
bench/macos:
extends:
- .bench/common
- .rules/bench
variables:
UPSTREAM_JOB_TARGET: macos
bench/windows:
extends:
- .bench/common
- .rules/bench
variables:
UPSTREAM_JOB_TARGET: windows
pages:
extends:
- .rules/push-master-or-feat
stage: deploy
needs:
- check/linux/node
before_script: []
script:
- mv lcov-report/ public/
artifacts:
paths:
- public
expire_in: 7 days
tags: !reference [.tags/linux, tags]
variables:
GIT_STRATEGY: none
bridge/compat:
stage: bridge-check
extends:
- .variables/bridge-common
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
needs:
- check/linux/node
- check/bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/js
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
check/e2e:
stage: check
extends:
- .npm-cache
rules:
- !reference [.rules/mr/manual, rules]
- !reference [.rules/nightly, rules]
script:
- poetry run python run-ci.py e2e
tags: !reference [.tags/compilation-linux, tags]
image: registry.gitlab.com/tankerhq/docker/e2e:latest
audit:
extends:
- .npm-cache
- .rules/nightly
stage: check
script:
- npm install
- npm audit --omit dev
tags: !reference [.tags/linux, tags]
deploy:
stage: deploy
extends:
- .rules/deploy/js
script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "${HOME}/.npmrc"
- poetry run python run-ci.py deploy --version "${SDK_JS_RELEASE_VERSION}"
release:
description: sdk-js v${SDK_JS_RELEASE_VERSION}
tag_name: v${SDK_JS_RELEASE_VERSION}
tags: !reference [.tags/linux, tags]
test/deployed:
stage: deploy
needs:
- deploy
extends:
- .npm-cache
- .rules/deploy/js
script:
- poetry run python run-ci.py test-deploy --version "${SDK_JS_RELEASE_VERSION}"
tags: !reference [.tags/linux, tags]
bridge/bumpjs-compat-tests:
stage: deploy
needs:
- deploy
- check/bridge-dotenv
extends:
- .variables/bridge-common
rules:
- if: !reference [.if-invalid-js-release-version, if]
when: never
- if: !reference [.if-web-pipeline, if]
when: manual
variables:
SDK_JS_RELEASE_VERSION: $SDK_JS_RELEASE_VERSION
UPSTREAM_JOB_NAME: deploy
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend