-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
439 lines (383 loc) · 10.7 KB
/
.gitlab-ci.yml
File metadata and controls
439 lines (383 loc) · 10.7 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
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
include:
project: TankerHQ/gitlab-ci-files
file: /common.yml
ref: 2025-06-02-284
variables:
SDK_NATIVE_CONAN_REFERENCE: tanker/latest-stable@
RUBY_3_4: 3.4.1
RUBY_3_3: 3.3.6
RUBY_3_2: 3.2.6
PROFILE_LINUX_X86_64: --profile linux-x86_64 shared no-http-backend
PROFILE_LINUX_ARM: --profile linux-armv8 shared no-http-backend
PROFILE_MAC_X86: --profile macos-x86_64 shared no-http-backend
PROFILE_MAC_ARM: --profile macos-armv8 shared no-http-backend
RBENV_VERSION: $RUBY_3_4
############
# Workflow #
############
workflow:
rules:
# web pipelines for releases only
- if: $CI_PIPELINE_SOURCE == "web" && $SDK_RUBY_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:
- poetry -V
- poetry run python -m pip install --upgrade pip
- poetry install
- poetry run python --version
image: registry.gitlab.com/tankerhq/docker/sdk-ruby:latest
##########
# Stages #
##########
stages:
- lint
- prepare
- check
- deploy
#############################
# Default settings override #
#############################
.before-script/download-artifacts:
before_script:
- poetry -V
- poetry run python -m pip install --upgrade pip
- poetry install
- poetry run python --version
- poetry run python run-ci.py download-artifacts --project-id=$UPSTREAM_PROJECT_ID --pipeline-id=$UPSTREAM_PIPELINE_ID --job-name=$UPSTREAM_JOB_NAME
.before-script/rbenv-path:
before_script:
- poetry -V
- poetry run python -m pip install --upgrade pip
- poetry install
- poetry run python --version
- export PATH=$HOME/.rbenv/shims:$PATH
- rbenv version
.before-script/rbenv-path-download-artifacts:
before_script:
- !reference [.before-script/rbenv-path, 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
#################
# Extend blocks #
#################
.release-artifacts:
artifacts:
paths:
- vendor/tanker
##############
# lint stage #
##############
# Prevent the pipeline from passing unless the lint job is started manually
# There is no way to require _one of_ the manual checks job,
# it's all blocking or nothing blocks the pipeline. So we require manual lint instead
lint:
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/push-master, rules]
stage: lint
extends:
- .tags/linux
- .before-script/rbenv-path
script:
- poetry run python run-ci.py lint
tags: !reference [.tags/linux, tags]
#################
# prepare stage #
#################
.rules/prepare:
rules:
- !reference [.rules/web/auto, rules]
- !reference [.rules/mr/manual, rules]
- !reference [.rules/deploy-pipeline, rules]
.prepare:
stage: prepare
extends:
- .before-script/rbenv-path
- .rules/prepare
- .release-artifacts
script:
- poetry run python run-ci.py --isolate-conan-user-home --remote $CONAN_REMOTE prepare --use-tanker=deployed --tanker-ref $SDK_NATIVE_CONAN_REFERENCE $TANKER_PROFILES
prepare/linux/x86_64:
extends:
- .prepare
variables:
TANKER_PROFILES: $PROFILE_LINUX_X86_64
tags: !reference [.tags/linux, tags]
prepare/linux/arm:
extends:
- .prepare
variables:
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/linux, tags]
prepare/macos/x86_64:
extends:
- .tags/macos/x86_64
- .prepare
variables:
TANKER_PROFILES: $PROFILE_MAC_X86
prepare/macos/arm:
extends:
- .tags/macos/arm
- .prepare
variables:
TANKER_PROFILES: $PROFILE_MAC_ARM
###############
# check stage #
###############
.check/native-from-sources:
stage: check
extends:
- .rules/native-from-sources
- .before-script/rbenv-path
dependencies: []
script:
- poetry run python run-ci.py --isolate-conan-user-home --remote $CONAN_REMOTE prepare --use-tanker=same-as-branch $TANKER_PROFILES
- poetry run python run-ci.py --isolate-conan-user-home --remote $CONAN_REMOTE build $TEST
check/native-from-sources/linux/x86_64/3.2:
extends:
- .check/native-from-sources
variables:
RBENV_VERSION: $RUBY_3_2
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
tags: !reference [.tags/compilation-linux, tags]
check/native-from-sources/linux/arm/3.2:
extends:
- .check/native-from-sources
variables:
RBENV_VERSION: $RUBY_3_2
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/compilation-linux, tags]
check/native-from-sources/linux/x86_64/3.3:
extends:
- .check/native-from-sources
variables:
RBENV_VERSION: $RUBY_3_3
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
tags: !reference [.tags/compilation-linux, tags]
check/native-from-sources/linux/arm/3.3:
extends:
- .check/native-from-sources
variables:
RBENV_VERSION: $RUBY_3_3
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/compilation-linux, tags]
check/native-from-sources/linux/x86_64/3.4:
extends:
- .check/native-from-sources
variables:
RBENV_VERSION: $RUBY_3_4
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
tags: !reference [.tags/compilation-linux, tags]
check/native-from-sources/linux/arm/3.4:
extends:
- .check/native-from-sources
variables:
RBENV_VERSION: $RUBY_3_4
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/compilation-linux, tags]
check/native-from-sources/macos/x86_64:
extends:
- .tags/macos/x86_64
- .check/native-from-sources
variables:
TANKER_PROFILES: $PROFILE_MAC_X86
check/native-from-sources/macos/arm:
extends:
- .tags/macos/arm
- .check/native-from-sources
variables:
TANKER_PROFILES: $PROFILE_MAC_ARM
.rules/check/deployed-native:
rules:
- !reference [.rules/mr/manual, rules]
- !reference [.rules/web/auto, rules]
.check/deployed-native:
stage: check
extends:
- .before-script/rbenv-path
- .rules/check/deployed-native
script:
- poetry run python run-ci.py --isolate-conan-user-home --remote $CONAN_REMOTE build $TEST
check/deployed-native/linux/x86_64/3.2:
extends:
- .check/deployed-native
variables:
RBENV_VERSION: $RUBY_3_2
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
needs:
- prepare/linux/x86_64
tags: !reference [.tags/linux, tags]
check/deployed-native/linux/arm/3.2:
extends:
- .check/deployed-native
variables:
RBENV_VERSION: $RUBY_3_2
TANKER_PROFILES: $PROFILE_LINUX_ARM
needs:
- prepare/linux/arm
tags: !reference [.tags/linux, tags]
check/deployed-native/linux/x86_64/3.3:
extends:
- .check/deployed-native
variables:
RBENV_VERSION: $RUBY_3_3
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
needs:
- prepare/linux/x86_64
tags: !reference [.tags/linux, tags]
check/deployed-native/linux/arm/3.3:
extends:
- .check/deployed-native
variables:
RBENV_VERSION: $RUBY_3_3
TANKER_PROFILES: $PROFILE_LINUX_ARM
needs:
- prepare/linux/arm
tags: !reference [.tags/linux, tags]
check/deployed-native/linux/x86_64/3.4:
extends:
- .check/deployed-native
variables:
RBENV_VERSION: $RUBY_3_4
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
needs:
- prepare/linux/x86_64
tags: !reference [.tags/linux, tags]
check/deployed-native/linux/arm/3.4:
extends:
- .check/deployed-native
variables:
RBENV_VERSION: $RUBY_3_4
TANKER_PROFILES: $PROFILE_LINUX_ARM
needs:
- prepare/linux/arm
tags: !reference [.tags/linux, tags]
check/deployed-native/macos/x86_64:
extends:
- .tags/macos/x86_64
- .check/deployed-native
variables:
TANKER_PROFILES: $PROFILE_MAC_X86
TEST: --test
needs:
- prepare/macos/x86_64
check/deployed-native/macos/arm:
extends:
- .tags/macos/arm
- .check/deployed-native
variables:
TANKER_PROFILES: $PROFILE_MAC_ARM
TEST: --test
needs:
- prepare/macos/arm
.check/downstream:
stage: check
extends:
- .before-script/rbenv-path-download-artifacts
dependencies: []
script:
- poetry run python run-ci.py --isolate-conan-user-home --remote $CONAN_REMOTE prepare --use-tanker=upstream $TANKER_PROFILES
- poetry run python run-ci.py --isolate-conan-user-home --remote $CONAN_REMOTE build $TEST
check/downstream/linux/x86_64/3.2:
extends:
- .check/downstream
- .rules/check/downstream/linux/x86_64
variables:
RBENV_VERSION: $RUBY_3_2
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
tags: !reference [.tags/linux, tags]
check/downstream/linux/arm/3.2:
extends:
- .check/downstream
- .rules/check/downstream/linux/arm
variables:
RBENV_VERSION: $RUBY_3_2
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/linux, tags]
check/downstream/linux/x86_64/3.3:
extends:
- .check/downstream
- .rules/check/downstream/linux/x86_64
variables:
RBENV_VERSION: $RUBY_3_3
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
tags: !reference [.tags/linux, tags]
check/downstream/linux/arm/3.3:
extends:
- .check/downstream
- .rules/check/downstream/linux/arm
variables:
RBENV_VERSION: $RUBY_3_3
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/linux, tags]
check/downstream/linux/x86_64/3.4:
extends:
- .check/downstream
- .rules/check/downstream/linux/x86_64
variables:
RBENV_VERSION: $RUBY_3_4
TANKER_PROFILES: $PROFILE_LINUX_X86_64
TEST: --test
tags: !reference [.tags/linux, tags]
check/downstream/linux/arm/3.4:
extends:
- .check/downstream
- .rules/check/downstream/linux/arm
variables:
RBENV_VERSION: $RUBY_3_4
TANKER_PROFILES: $PROFILE_LINUX_ARM
tags: !reference [.tags/linux, tags]
check/downstream/macos/x86_64:
extends:
- .tags/macos/x86_64
- .check/downstream
- .rules/check/downstream/macos/x86_64
variables:
TANKER_PROFILES: $PROFILE_MAC_X86
TEST: --test
check/downstream/macos/arm:
extends:
- .tags/macos/arm
- .check/downstream
- .rules/check/downstream/macos/arm
variables:
TANKER_PROFILES: $PROFILE_MAC_ARM
TEST: --test
################
# deploy stage #
################
deploy:
stage: deploy
extends:
- .rules/deploy/ruby
- .before-script/rbenv-path
script:
- poetry run python run-ci.py deploy --version $SDK_RUBY_RELEASE_VERSION
needs:
- prepare/linux/x86_64
- prepare/linux/arm
- prepare/macos/x86_64
- prepare/macos/arm
release:
description: sdk-ruby v$SDK_RUBY_RELEASE_VERSION
tag_name: v$SDK_RUBY_RELEASE_VERSION
tags: !reference [.tags/linux, tags]