-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
413 lines (370 loc) · 11 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
include:
- project: TankerHQ/gitlab-ci-files
ref: 2023-08-09-267
file: /common.yml
variables:
SDK_NATIVE_CONAN_REFERENCE: tanker/latest-stable@
GIT_DEPTH: 1
############
# Workflow #
############
workflow:
rules:
# web pipelines for releases only
- if: $CI_PIPELINE_SOURCE == "web" && $SDK_ANDROID_RELEASE_VERSION !~ /\A\d+\.\d+\.\d+(-(alpha|beta)\d+)?\z/
when: never
- if: !reference [.if-invalid-native-conan-reference, if]
when: never
- if: '$CI_MERGE_REQUEST_TITLE =~ /.*\[preview].*/'
variables:
CONAN_REMOTE: "artifactory-preview"
- when: always
variables:
CONAN_REMOTE: "artifactory"
###########
# Default #
###########
default:
before_script: &global_before_script
- poetry run python -m pip install --upgrade pip
- poetry install
image: registry.gitlab.com/tankerhq/docker/sdk-android:latest
##########
# Stages #
##########
stages:
- check
- bridge-check
- deploy
#############################
# Default settings override #
#############################
.before-script/download-artifacts:
before_script:
- *global_before_script
- poetry run python run-ci.py download-artifacts --project-id=$UPSTREAM_PROJECT_ID --pipeline-id=$UPSTREAM_PIPELINE_ID --job-name=$UPSTREAM_JOB_NAME
- poetry run python run-ci.py reset-branch $(cat branch_name.txt)
- poetry run python -m pip install --upgrade pip
- poetry install
###############
# check stage #
###############
.artifacts:
artifacts:
when: always
paths:
- artifacts
- branch_name.txt
- screenshot.png
.rules/check/deployed-native:
rules:
- !reference [.rules/web/auto, rules]
- !reference [.rules/mr/manual, rules]
.check/deployed-native:
extends:
- .rules/check/deployed-native
- .artifacts
stage: check
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py --remote $CONAN_REMOTE --isolate-conan-user-home build-and-test --use-tanker=deployed --tanker-ref=$SDK_NATIVE_CONAN_REFERENCE --android-api-level=$ANDROID_API_LEVEL
- echo $CI_COMMIT_REF_NAME > branch_name.txt
tags: !reference [.tags/compilation-linux, tags]
check/oldest/deployed-native:
extends:
- .check/deployed-native
variables:
ANDROID_API_LEVEL: oldest
check/latest/deployed-native:
extends:
- .check/deployed-native
variables:
ANDROID_API_LEVEL: latest
.check/native-from-sources:
extends:
- .rules/native-from-sources
- .artifacts
stage: check
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py --remote $CONAN_REMOTE --isolate-conan-user-home build-and-test --use-tanker=same-as-branch --android-api-level=$ANDROID_API_LEVEL
- echo $CI_COMMIT_REF_NAME > branch_name.txt
tags: !reference [.tags/compilation-linux, tags]
check/oldest/native-from-sources:
extends:
- .check/native-from-sources
variables:
ANDROID_API_LEVEL: oldest
check/latest/native-from-sources:
extends:
- .check/native-from-sources
variables:
ANDROID_API_LEVEL: latest
.check/downstream:
extends:
- .before-script/download-artifacts
- .rules/check/downstream
- .artifacts
stage: check
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py --remote $CONAN_REMOTE --isolate-conan-user-home build-and-test --use-tanker=upstream --android-api-level=$ANDROID_API_LEVEL
tags: !reference [.tags/compilation-linux, tags]
check/oldest/downstream:
extends:
- .check/downstream
variables:
ANDROID_API_LEVEL: oldest
check/latest/downstream:
extends:
- .check/downstream
variables:
ANDROID_API_LEVEL: latest
######################
# bridge-check stage #
######################
bridge-dotenv:
stage: bridge-check
inherit:
default: [] # Skip docker image
rules:
# Start with accept-only rules, these must **NOT** contain a when: never
- !reference [ .rules/push-master-or-feat, rules ]
- !reference [ .rules/mr/manual, rules ]
- !reference [ .rules/nightly, rules ]
- !reference [ .rules/check/downstream, rules ]
# Deploy pipeline checks start here, this must be the *ONLY* when: never in these rules!
- if: !reference [ .if-invalid-android-release-version, if ]
when: never
- !reference [ .rules/web/auto, rules ]
- !reference [ .rules/deploy-pipeline, rules ]
before_script:
- *global_before_script
script:
- poetry run python run-ci.py write-bridge-dotenv --downstream compatibility-tests
--downstream sdk-react-native
artifacts:
expire_in: 7 days
reports:
dotenv: bridge.env
tags: !reference [.tags/linux, tags]
.bridge/compat-variables:
variables:
UPSTREAM_JOB_TARGET: android
UPSTREAM_COMMIT_REF_NAME: $CI_COMMIT_REF_NAME
.bridge/compat-from-sources:
stage: bridge-check
extends:
- .variables/bridge-common
- .rules/native-from-sources
- .bridge/compat-variables
bridge/latest/compat-from-sources:
extends:
- .bridge/compat-from-sources
needs:
- check/latest/native-from-sources
- bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/latest/native-from-sources
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
bridge/oldest/compat-from-sources:
extends:
- .bridge/compat-from-sources
needs:
- check/oldest/native-from-sources
- bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/oldest/native-from-sources
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
.bridge/compat-downstream:
stage: bridge-check
extends:
- .variables/bridge-common
- .bridge/compat-variables
rules:
- if: !reference [.if-upstream-ci-pipeline, if]
bridge/latest/compat-downstream:
extends:
- .bridge/compat-downstream
needs:
- check/latest/downstream
- bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/latest/downstream
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
bridge/oldest/compat-downstream:
extends:
- .bridge/compat-downstream
needs:
- check/oldest/downstream
- bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/oldest/downstream
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
.bridge/compat-deployed:
stage: bridge-check
extends:
- .variables/bridge-common
- .bridge/compat-variables
variables:
SDK_NATIVE_CONAN_REFERENCE: $SDK_NATIVE_CONAN_REFERENCE
rules:
# only run during standalone SDK releases
- if: !reference [.if-invalid-android-release-version, if]
when: never
- !reference [.rules/web/auto, rules]
bridge/latest/compat-deployed:
extends:
- .bridge/compat-deployed
needs:
- check/latest/deployed-native
- bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/latest/deployed-native
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
bridge/oldest/compat-deployed:
extends:
- .bridge/compat-deployed
needs:
- check/oldest/deployed-native
- bridge-dotenv
variables:
UPSTREAM_JOB_NAME: check/oldest/deployed-native
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
.bridge/react-native:
stage: bridge-check
extends:
- .variables/bridge-common
needs:
- bridge-dotenv
variables:
UPSTREAM_JOB_TARGET: android
UPSTREAM_COMMIT_REF_NAME: $CI_COMMIT_REF_NAME
trigger:
project: TankerHQ/sdk-react-native
branch: $SDK_REACT_NATIVE_BRIDGE_BRANCH
strategy: depend
bridge/oldest/react-native-from-sources:
extends:
- .bridge/react-native
- .rules/native-from-sources
needs:
- !reference [.bridge/react-native, needs]
- check/oldest/native-from-sources
variables:
UPSTREAM_JOB_NAME: check/oldest/native-from-sources
bridge/latest/react-native-from-sources:
extends:
- .bridge/react-native
- .rules/native-from-sources
needs:
- !reference [.bridge/react-native, needs]
- check/latest/native-from-sources
variables:
UPSTREAM_JOB_NAME: check/latest/native-from-sources
bridge/oldest/react-native-downstream:
extends:
- .bridge/react-native
rules:
- if: !reference [.if-upstream-ci-pipeline, if]
needs:
- !reference [.bridge/react-native, needs]
- check/oldest/downstream
variables:
UPSTREAM_JOB_NAME: check/oldest/downstream
bridge/latest/react-native-downstream:
extends:
- .bridge/react-native
rules:
- if: !reference [.if-upstream-ci-pipeline, if]
needs:
- !reference [.bridge/react-native, needs]
- check/latest/downstream
variables:
UPSTREAM_JOB_NAME: check/latest/downstream
bridge/oldest/react-native-deployed:
extends:
- .bridge/react-native
rules:
# only run during standalone SDK releases
- if: !reference [.if-invalid-android-release-version, if]
when: never
- !reference [.rules/web/auto, rules]
needs:
- !reference [.bridge/react-native, needs]
- check/oldest/deployed-native
variables:
UPSTREAM_JOB_NAME: check/oldest/deployed-native
SDK_NATIVE_CONAN_REFERENCE: $SDK_NATIVE_CONAN_REFERENCE
bridge/latest/react-native-deployed:
extends:
- .bridge/react-native
rules:
# only run during standalone SDK releases
- if: !reference [.if-invalid-android-release-version, if]
when: never
- !reference [.rules/web/auto, rules]
needs:
- !reference [.bridge/react-native, needs]
- check/latest/deployed-native
variables:
UPSTREAM_JOB_NAME: check/latest/deployed-native
SDK_NATIVE_CONAN_REFERENCE: $SDK_NATIVE_CONAN_REFERENCE
################
# deploy stage #
################
deploy:
extends:
- .rules/deploy/android
stage: deploy
script:
- sudo chgrp 1000 -f /dev/kvm
- poetry run python run-ci.py reset-branch $UPSTREAM_BRANCH_NAME
- poetry run python run-ci.py --remote $CONAN_REMOTE --isolate-conan-user-home deploy --version $SDK_ANDROID_RELEASE_VERSION --tanker-ref $SDK_NATIVE_CONAN_REFERENCE
release:
description: sdk-android v$SDK_ANDROID_RELEASE_VERSION
tag_name: v$SDK_ANDROID_RELEASE_VERSION
tags: !reference [.tags/compilation-linux, tags]
brige/bump-android-compat-tests:
stage: deploy
extends:
- .variables/bridge-common
rules:
- if: !reference [.if-invalid-android-release-version, if]
when: never
- if: !reference [.if-web-pipeline, if]
when: manual
- if: !reference [.if-upstream-release-deploy-stage, if]
when: manual
needs:
- deploy
- bridge-dotenv
variables:
SDK_ANDROID_RELEASE_VERSION: $SDK_ANDROID_RELEASE_VERSION
SDK_NATIVE_CONAN_REFERENCE: $SDK_NATIVE_CONAN_REFERENCE
UPSTREAM_JOB_NAME: deploy
UPSTREAM_JOB_TARGET: android
UPSTREAM_COMMIT_REF_NAME: $CI_COMMIT_REF_NAME
trigger:
project: TankerHQ/compatibility-tests
branch: $COMPATIBILITY_TESTS_BRIDGE_BRANCH
strategy: depend
allow_failure: true