@@ -4,10 +4,21 @@ stages:
4
4
- test
5
5
- ui-test
6
6
- smoke-test
7
+ - e2e-test
8
+ - dogfood
9
+ - release-build
10
+ - release-publish
7
11
8
12
variables :
9
13
MAIN_BRANCH : " master"
10
14
DEVELOP_BRANCH : " develop"
15
+ # Prefilled variables for running a pipeline manually:
16
+ # Ref.: https://docs.gitlab.com/ee/ci/pipelines/index.html#prefill-variables-in-manual-pipelines
17
+ RELEASE_GIT_TAG :
18
+ description : " The Git tag for the release pipeline. If set, release pipeline will be triggered for the given tag."
19
+ RELEASE_DRY_RUN :
20
+ value : " 1"
21
+ description : " Controls the dry run mode for the release pipeline. If set to '1', the pipeline will execute all steps but will not publish artifacts. If set to '0', the pipeline will run fully."
11
22
12
23
default :
13
24
tags :
@@ -18,36 +29,42 @@ default:
18
29
# │ Utility jobs: │
19
30
# └───────────────┘
20
31
21
- # Trigger jobs on 'develop' and 'master' branches
22
- .run:when-develop-or-master :
23
- rules :
24
- - if : ' $CI_COMMIT_BRANCH == $DEVELOP_BRANCH || $CI_COMMIT_BRANCH == $MAIN_BRANCH '
25
- when : always
32
+ # Utility jobs define rules for including or excluding dependent jobs from the pipeline.
33
+ #
34
+ # Ref.: https://docs.gitlab.com/ee/ci/jobs/job_rules.html
35
+ # > Rules are evaluated in order until the first match. When a match is found, the job is either included or excluded
36
+ # > from the pipeline, depending on the configuration.
26
37
27
- # Trigger jobs on SDK code changes, comparing against 'develop' branch
28
- .run:if-sdk-modified :
38
+ .test-pipeline-job :
29
39
rules :
30
- - changes :
40
+ - if : ' $CI_COMMIT_BRANCH == $DEVELOP_BRANCH || $CI_COMMIT_BRANCH == $MAIN_BRANCH' # always on main branches
41
+ - if : ' $CI_COMMIT_BRANCH' # when on other branch with following changes compared to develop
42
+ changes :
31
43
paths :
32
44
- " Datadog*/**/*"
33
45
- " IntegrationTests/**/*"
46
+ - " SmokeTests/**/*"
34
47
- " TestUtilities/**/*"
35
48
- " *" # match any file in the root directory
36
- compare_to : ' develop' # cannot use variable due to: https://gitlab.com/gitlab-org/gitlab/-/issues/369916
49
+ compare_to : ' develop' # cannot use $DEVELOP_BRANCH var due to: https://gitlab.com/gitlab-org/gitlab/-/issues/369916
37
50
38
- # Trigger jobs on changes in `tools/*`, comparing against 'develop' branch
39
- .run:if-tools-modified :
40
- rules :
41
- - changes :
42
- paths :
43
- - " tools/**/* "
44
- - " Makefile "
45
- - " .gitlab-ci.yml "
46
- compare_to : ' develop '
51
+ .release-pipeline-job :
52
+ rules :
53
+ - if : ' $CI_COMMIT_TAG || $RELEASE_GIT_TAG '
54
+
55
+ .release-pipeline-delayed-job :
56
+ rules :
57
+ - if : ' $CI_COMMIT_TAG || $RELEASE_GIT_TAG '
58
+ when : delayed
59
+ start_in : 20 minutes
47
60
48
61
ENV check :
49
62
stage : pre
63
+ rules :
64
+ - !reference [.test-pipeline-job, rules]
65
+ - !reference [.release-pipeline-job, rules]
50
66
script :
67
+ - ./tools/runner-setup.sh --datadog-ci # temporary, waiting for AMI
51
68
- make env-check
52
69
53
70
# ┌──────────────────────────┐
@@ -57,8 +74,7 @@ ENV check:
57
74
Lint :
58
75
stage : lint
59
76
rules :
60
- - !reference [.run:when-develop-or-master, rules]
61
- - !reference [.run:if-sdk-modified, rules]
77
+ - !reference [.test-pipeline-job, rules]
62
78
script :
63
79
- make clean repo-setup ENV=ci
64
80
- make lint license-check
67
83
Unit Tests (iOS) :
68
84
stage : test
69
85
rules :
70
- - !reference [.run:when-develop-or-master , rules]
71
- - !reference [.run:if-sdk-modified , rules]
86
+ - !reference [.test-pipeline-job , rules]
87
+ - !reference [.release-pipeline-job , rules]
72
88
variables :
73
89
XCODE : " 15.3.0"
74
90
OS : " 17.4"
@@ -82,8 +98,8 @@ Unit Tests (iOS):
82
98
Unit Tests (tvOS) :
83
99
stage : test
84
100
rules :
85
- - !reference [.run:when-develop-or-master , rules]
86
- - !reference [.run:if-sdk-modified , rules]
101
+ - !reference [.test-pipeline-job , rules]
102
+ - !reference [.release-pipeline-job , rules]
87
103
variables :
88
104
XCODE : " 15.3.0"
89
105
OS : " 17.4"
@@ -97,8 +113,8 @@ Unit Tests (tvOS):
97
113
UI Tests :
98
114
stage : ui-test
99
115
rules :
100
- - !reference [.run:when-develop-or-master , rules]
101
- - !reference [.run:if-sdk-modified , rules]
116
+ - !reference [.test-pipeline-job , rules]
117
+ - !reference [.release-pipeline-job , rules]
102
118
variables :
103
119
XCODE : " 15.3.0"
104
120
OS : " 17.4"
@@ -116,17 +132,46 @@ UI Tests:
116
132
- make clean repo-setup ENV=ci
117
133
- make ui-test TEST_PLAN="$TEST_PLAN" OS="$OS" PLATFORM="$PLATFORM" DEVICE="$DEVICE"
118
134
135
+ SR Snapshot Tests :
136
+ stage : ui-test
137
+ rules :
138
+ - !reference [.test-pipeline-job, rules]
139
+ - !reference [.release-pipeline-job, rules]
140
+ variables :
141
+ XCODE : " 15.4.0"
142
+ OS : " 17.5"
143
+ PLATFORM : " iOS Simulator"
144
+ DEVICE : " iPhone 15"
145
+ ARTIFACTS_PATH : " artifacts"
146
+ artifacts :
147
+ paths :
148
+ - artifacts
149
+ expire_in : 1 week
150
+ when : on_failure
151
+ script :
152
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --os "$OS" --ssh # temporary, waiting for AMI
153
+ - make clean repo-setup ENV=ci
154
+ - make sr-snapshots-pull sr-snapshot-test OS="$OS" PLATFORM="$PLATFORM" DEVICE="$DEVICE" ARTIFACTS_PATH="$ARTIFACTS_PATH"
155
+
119
156
Tools Tests :
120
157
stage : test
121
- rules :
122
- - !reference [.run:when-develop-or-master, rules]
123
- - !reference [.run:if-tools-modified, rules]
158
+ rules :
159
+ - if : ' $CI_COMMIT_BRANCH' # when on branch with following changes compared to develop
160
+ changes :
161
+ paths :
162
+ - " tools/**/*"
163
+ - " Makefile"
164
+ - " .gitlab-ci.yml"
165
+ compare_to : ' develop'
124
166
script :
125
167
- make clean repo-setup ENV=ci
126
168
- make tools-test
127
169
128
170
Smoke Tests (iOS) :
129
171
stage : smoke-test
172
+ rules :
173
+ - !reference [.test-pipeline-job, rules]
174
+ - !reference [.release-pipeline-job, rules]
130
175
tags :
131
176
- macos:ventura
132
177
- specific:true
@@ -136,13 +181,16 @@ Smoke Tests (iOS):
136
181
PLATFORM : " iOS Simulator"
137
182
DEVICE : " iPhone 15 Pro"
138
183
script :
139
- - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "$OS" # temporary, waiting for AMI
184
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "$OS" --ssh # temporary, waiting for AMI
140
185
- make clean repo-setup ENV=ci
141
186
- make spm-build-ios
142
187
- make smoke-test-ios-all OS="$OS" PLATFORM="$PLATFORM" DEVICE="$DEVICE"
143
188
144
189
Smoke Tests (tvOS) :
145
190
stage : smoke-test
191
+ rules :
192
+ - !reference [.test-pipeline-job, rules]
193
+ - !reference [.release-pipeline-job, rules]
146
194
tags :
147
195
- macos:ventura
148
196
- specific:true
@@ -152,13 +200,16 @@ Smoke Tests (tvOS):
152
200
PLATFORM : " tvOS Simulator"
153
201
DEVICE : " Apple TV"
154
202
script :
155
- - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "$OS" # temporary, waiting for AMI
203
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "$OS" --ssh # temporary, waiting for AMI
156
204
- make clean repo-setup ENV=ci
157
205
- make spm-build-tvos
158
206
- make smoke-test-tvos-all OS="$OS" PLATFORM="$PLATFORM" DEVICE="$DEVICE"
159
207
160
208
Smoke Tests (visionOS) :
161
209
stage : smoke-test
210
+ rules :
211
+ - !reference [.test-pipeline-job, rules]
212
+ - !reference [.release-pipeline-job, rules]
162
213
tags :
163
214
- macos:ventura
164
215
- specific:true
@@ -172,6 +223,9 @@ Smoke Tests (visionOS):
172
223
173
224
Smoke Tests (macOS) :
174
225
stage : smoke-test
226
+ rules :
227
+ - !reference [.test-pipeline-job, rules]
228
+ - !reference [.release-pipeline-job, rules]
175
229
tags :
176
230
- macos:ventura
177
231
- specific:true
@@ -181,3 +235,149 @@ Smoke Tests (macOS):
181
235
- ./tools/runner-setup.sh --xcode "$XCODE" # temporary, waiting for AMI
182
236
- make clean repo-setup ENV=ci
183
237
- make spm-build-macos
238
+
239
+ Smoke Tests (watchOS) :
240
+ stage : smoke-test
241
+ rules :
242
+ - !reference [.test-pipeline-job, rules]
243
+ - !reference [.release-pipeline-job, rules]
244
+ tags :
245
+ - macos:ventura
246
+ - specific:true
247
+ variables :
248
+ XCODE : " 15.2.0"
249
+ OS : " 10.2"
250
+ script :
251
+ - ./tools/runner-setup.sh --xcode "$XCODE" --watchOS --os "$OS" # temporary, waiting for AMI
252
+ - make clean repo-setup ENV=ci
253
+ - make spm-build-watchos
254
+
255
+ # ┌──────────────────────┐
256
+ # │ E2E Test app upload: │
257
+ # └──────────────────────┘
258
+
259
+ E2E Test (upload to s8s) :
260
+ stage : e2e-test
261
+ rules :
262
+ - if : ' $CI_COMMIT_BRANCH == $DEVELOP_BRANCH'
263
+ variables :
264
+ XCODE : " 15.3.0"
265
+ OS : " 17.4"
266
+ artifacts :
267
+ paths :
268
+ - artifacts
269
+ expire_in : 2 weeks
270
+ script :
271
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --os "$OS" --datadog-ci # temporary, waiting for AMI
272
+ - make clean
273
+ - export DRY_RUN=${DRY_RUN:-0} # default to 0 if not specified
274
+ - make e2e-build-upload ARTIFACTS_PATH="artifacts/e2e"
275
+
276
+ # ┌─────────────────┐
277
+ # │ SDK dogfooding: │
278
+ # └─────────────────┘
279
+
280
+ Dogfood (Shopist) :
281
+ stage : dogfood
282
+ rules :
283
+ - if : ' $CI_COMMIT_BRANCH == $DEVELOP_BRANCH'
284
+ when : manual
285
+ allow_failure : true
286
+ script :
287
+ - ./tools/runner-setup.sh --ssh # temporary, waiting for AMI
288
+ - DRY_RUN=0 make dogfood-shopist
289
+
290
+ Dogfood (Datadog app) :
291
+ stage : dogfood
292
+ rules :
293
+ - if : ' $CI_COMMIT_BRANCH == $DEVELOP_BRANCH'
294
+ when : manual
295
+ allow_failure : true
296
+ script :
297
+ - ./tools/runner-setup.sh --ssh # temporary, waiting for AMI
298
+ - DRY_RUN=0 make dogfood-datadog-app
299
+
300
+ # ┌──────────────┐
301
+ # │ SDK release: │
302
+ # └──────────────┘
303
+
304
+ .release-before-script : &export_MAKE_release_params
305
+ - export GIT_TAG=${RELEASE_GIT_TAG:-$CI_COMMIT_TAG} # CI_COMMIT_TAG if set, otherwise default to RELEASE_GIT_TAG
306
+ - if [ -z "$GIT_TAG" ]; then echo "GIT_TAG is not set"; exit 1; fi # sanity check
307
+ - export ARTIFACTS_PATH="artifacts/$GIT_TAG"
308
+ - export DRY_RUN=${CI_COMMIT_TAG:+0} # 0 if CI_COMMIT_TAG is set
309
+ - export DRY_RUN=${DRY_RUN:-$RELEASE_DRY_RUN} # otherwise default to RELEASE_DRY_RUN
310
+
311
+ Build Artifacts :
312
+ stage : release-build
313
+ rules :
314
+ - !reference [.release-pipeline-job, rules]
315
+ variables :
316
+ XCODE : " 15.3.0"
317
+ artifacts :
318
+ paths :
319
+ - artifacts
320
+ expire_in : 4 weeks
321
+ before_script :
322
+ - *export_MAKE_release_params
323
+ script :
324
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "17.4" --ssh # temporary, waiting for AMI
325
+ - make env-check
326
+ - make clean
327
+ - make release-build release-validate
328
+
329
+ Publish GH Asset :
330
+ stage : release-publish
331
+ rules :
332
+ - !reference [.release-pipeline-job, rules]
333
+ variables :
334
+ XCODE : " 15.3.0"
335
+ before_script :
336
+ - *export_MAKE_release_params
337
+ script :
338
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "17.4" # temporary, waiting for AMI
339
+ - make env-check
340
+ - make clean
341
+ - make release-publish-github
342
+
343
+ Publish CP podspecs (internal) :
344
+ stage : release-publish
345
+ rules :
346
+ - !reference [.release-pipeline-job, rules]
347
+ variables :
348
+ XCODE : " 15.3.0"
349
+ before_script :
350
+ - *export_MAKE_release_params
351
+ script :
352
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "17.4" # temporary, waiting for AMI
353
+ - make env-check
354
+ - make clean
355
+ - make release-publish-internal-podspecs
356
+
357
+ Publish CP podspecs (dependent) :
358
+ stage : release-publish
359
+ rules :
360
+ - !reference [.release-pipeline-delayed-job, rules]
361
+ variables :
362
+ XCODE : " 15.3.0"
363
+ before_script :
364
+ - *export_MAKE_release_params
365
+ script :
366
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "17.4" # temporary, waiting for AMI
367
+ - make env-check
368
+ - make clean
369
+ - make release-publish-dependent-podspecs
370
+
371
+ Publish CP podspecs (legacy) :
372
+ stage : release-publish
373
+ rules :
374
+ - !reference [.release-pipeline-delayed-job, rules]
375
+ variables :
376
+ XCODE : " 15.3.0"
377
+ before_script :
378
+ - *export_MAKE_release_params
379
+ script :
380
+ - ./tools/runner-setup.sh --xcode "$XCODE" --iOS --tvOS --os "17.4" # temporary, waiting for AMI
381
+ - make env-check
382
+ - make clean
383
+ - make release-publish-legacy-podspecs
0 commit comments