Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
749 lines (703 loc) · 24.4 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
749 lines (703 loc) · 24.4 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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
include:
- 'https://gitlab-templates.ddbuild.io/slack-notifier/v3-sdm/template.yml'
variables:
CURRENT_CI_IMAGE: "11"
BUILD_STABLE_REGISTRY: 486234852809.dkr.ecr.us-east-1.amazonaws.com
DISTRIBUTION_REGISTRY: registry.ddbuild.io
# Linux CI Images
CI_IMAGE_REPO: "ci/dd-sdk-flutter"
CI_IMAGE_DOCKER: ${BUILD_STABLE_REGISTRY}/${CI_IMAGE_REPO}:$CURRENT_CI_IMAGE
# Windows CI Images
CURRENT_WINDOWS_CI_IMAGE: "1"
WINDOWS_CI_IMAGE_DOCKER: ${DISTRIBUTION_REGISTRY}/${CI_IMAGE_REPO}:windows-$CURRENT_WINDOWS_CI_IMAGE
DD_CLIENT_TOKEN: "fake-token"
DD_APPLICATION_ID: "00000000-aaaa-0000-aaaa-000000000000"
IOS_SIMULATOR: "iPhone 17 Pro"
IOS_SDK: 'iOS-26'
ANDROID_EMULATOR_SDK: "33"
IS_ON_CI: $CI
SLACK_CHANNEL: "#mobile-sdk-ops"
# Flutter 3.38.0 bundles prerelease Dart; 3.38.1 includes stable Dart 3.10.
# https://github.com/flutter/flutter/issues/178400
FLUTTER_MIN_VERSION: '3.38.1'
# Magic Mirror Depot pro for the Java ecosystem (see
# tools/ci/gradle/init.d/depot-mirror.init.gradle).
DEPOT_JAVA_MAVEN_URL: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
KUBERNETES_MEMORY_REQUEST: "32Gi"
KUBERNETES_MEMORY_LIMIT: "48Gi"
KUBERNETES_CPU_REQUEST: 4
stages:
- ci-image
- build
- integration-test
- version-test
- e2e-test
- prepare-release
- post
- release-trigger
- post-nightly
# Prebuild - install necessary tools
.pre:
script:
- ulimit -S -n 2048
- export PATH=$PATH:$HOME/.pub-cache/bin
- flutter upgrade --force
- flutter --version
- flutter doctor
# SPM is the exception, make sure its disabled before starting the build
- flutter config --no-enable-swift-package-manager
- dart pub global activate melos
- dart pub global activate junitreport
- melos bootstrap
- mkdir -p $CI_PROJECT_DIR/.build/test-results/
- melos full_clean
- melos prepare
- pushd tools/ci && dart pub get && popd
.pre-web:
script:
- pushd tools/ci && dart pub get && dart run ci_helpers chrome_driver --extract && popd
- ./tools/ci/.tmp/chromedriver-linux64/chromedriver --version
- ./tools/ci/.tmp/chrome-linux64/chrome --version
- ./tools/ci/.tmp/chromedriver-linux64/chromedriver --port=4444 &
- export CHROME_EXECUTABLE=${CI_PROJECT_DIR}/tools/ci/.tmp/chrome-linux64/chrome
- export PATH="$PATH:${CI_PROJECT_DIR}/tools/ci/.tmp/chrome-linux64/"
- echo $CHROME_EXECUTABLE
- flutter doctor
.pre-ios:
script:
- xcode-select -p
- xcodebuild -runFirstLaunch
- xcodebuild -downloadPlatform iOS
- pushd tools/ci && dart run ci_helpers start_sim --platform ios --sdk $IOS_SDK --device $IOS_SIMULATOR && popd
.pre-macos:
script:
- xcode-select -p
- xcodebuild -runFirstLaunch
.install-gradle-mirror:
script:
- mkdir -p $HOME/.gradle/init.d
- cp $CI_PROJECT_DIR/tools/ci/gradle/init.d/depot-mirror.init.gradle $HOME/.gradle/init.d/
.pre-android:
script:
- !reference [.install-gradle-mirror, script]
- yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;36.0.0" "platform-tools" "platforms;android-36" || true
- yes | flutter doctor --android-licenses || true
# Kill all active emulators
- pushd tools/ci
- dart pub get && dart run ci_helpers stop_emu
- popd
- melos pub:get
- flutter doctor
.pre-web:
script:
- pushd tools/ci && dart pub get && dart run ci_helpers chrome_driver --extract && popd
- ./tools/ci/.tmp/chromedriver-linux64/chromedriver --version
- ./tools/ci/.tmp/chrome-linux64/chrome --version
- export CHROME_EXECUTABLE=${CI_PROJECT_DIR}/tools/ci/.tmp/chrome-linux64/chrome
- export PATH="$PATH:${CI_PROJECT_DIR}/tools/ci/.tmp/chrome-linux64/"
- echo $CHROME_EXECUTABLE
.tart-runner:
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-flutter-sequoia-latest
tags:
- macos:tart
ci-image:
when: manual
stage: ci-image
except: [tags, schedules]
tags: ["arch:amd64"]
image: "$BUILDENV_REGISTRY/docker:24.0.4-jammy"
script:
- DIGEST_FILE=$(mktemp)
- docker buildx build --tag registry.ddbuild.io/${CI_IMAGE_REPO}:${CURRENT_CI_IMAGE} --label target=build -f ci/linux/Dockerfile --push --metadata-file ${DIGEST_FILE} .
- ddsign sign registry.ddbuild.io/${CI_IMAGE_REPO}:${CURRENT_CI_IMAGE} --docker-metadata-file ${DIGEST_FILE}
ci-image-windows:
when: manual
stage: ci-image
except: [ tags, schedules ]
tags: [ "windows-v2:2022" ]
id_tokens:
CI_IDENTITIES_GITLAB_ID_TOKEN:
aud: ci-identities
variables:
OVERRIDE_GIT_STRATEGY: clone # Required for Windows runners
script:
- $ErrorActionPreference = "Stop"
- $env:WINDOWS_CI_IMAGE = "${env:DISTRIBUTION_REGISTRY}/${env:CI_IMAGE_REPO}:windows-${env:CURRENT_WINDOWS_CI_IMAGE}"
- docker build --tag ${env:WINDOWS_CI_IMAGE} --label target=build ./ci/windows
- If ($LASTEXITCODE -ne "0") { throw "docker build returned $LASTEXITCODE" }
- docker push ${env:WINDOWS_CI_IMAGE}
- If ($LASTEXITCODE -ne "0") { throw "docker push returned $LASTEXITCODE" }
# Build (And Analyze) Stage
build-flutter:
extends: .tart-runner
stage: build
except: [schedules]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- pushd tools/releaser && dart pub get && dart test && popd
- melos dartfmt_check
- melos run analyze:dart
- melos run unit_test:flutter
- melos run golden_test:flutter
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
build-android:
stage: build
except: [schedules]
image: $CI_IMAGE_DOCKER
tags: ["arch:amd64"]
script:
- !reference [.pre, script]
- !reference [.pre-android, script]
- melos run analyze:android
- melos run build:android
- melos run unit_test:android
- melos run verify:jni_bindings
artifacts:
when: always
expire_in: "30 days"
paths:
- "$CI_PROJECT_DIR/**/reports/detekt/*"
build-ios-spm:
extends: .tart-runner
stage: build
except: [schedules]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- !reference [.pre-ios, script]
- flutter config --enable-swift-package-manager
- melos remove_cocoapods
- melos pub:get
- melos run analyze:ios
- melos run build:ios
- melos run unit_test:ios
# dd-sdk-ios's CocoaPods podspecs don't declare macOS support (SPM-only for now), so
# macOS can only build via Swift Package Manager until that's fixed upstream.
build-macos-spm:
stage: build
except: [ schedules ]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
tags:
- macos:sequoia
- specific:true
script:
- !reference [.pre, script]
- !reference [.pre-macos, script]
- flutter config --enable-swift-package-manager
- melos remove_cocoapods
- melos pub:get
- melos run build:macos
- melos run unit_test:macos
build-ios:
extends: .tart-runner
stage: build
except: [schedules]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- !reference [.pre-ios, script]
- pod repo update
- melos pub:get
- melos remove_podfile_lock --no-select
- melos run analyze:ios
- melos run build:ios
- melos run unit_test:ios
- melos run verify:ios_ffi_bindings
build-web:
stage: build
except: [schedules]
image: $CI_IMAGE_DOCKER
tags:
- "arch:amd64"
script:
- !reference [.pre, script]
- !reference [.pre-web, script]
- melos run build:web
- melos run unit_test:web
- melos run unit_test:openfeature-web
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
build-linux:
stage: build
except: [ schedules ]
image: $CI_IMAGE_DOCKER
tags: [ "arch:amd64" ]
script:
- !reference [.pre, script]
- melos run build:linux
- melos run unit_test:linux
- melos run verify:ffi_bindings
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
# Windows shell-executor runners don't support the `image:` keyword, so unlike the
# Linux jobs (build-android/build-web), the toolchain image has to be run explicitly
# via `docker run` on the bare host.
build-windows:
stage: build
except: [ schedules ]
tags: [ "windows-v2:2022" ]
variables:
OVERRIDE_GIT_STRATEGY: clone # Required for Windows runners
script:
- $ErrorActionPreference = "Stop"
- >
docker run --rm
-v "$(Get-Location):C:\mnt"
-w C:\mnt
${env:WINDOWS_CI_IMAGE_DOCKER}
powershell -File C:\mnt\ci\windows\ci-build.ps1
- If ($LASTEXITCODE -ne "0") { throw "docker run (build) returned $LASTEXITCODE" }
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
# Integration Tests
android-integration-test:
stage: integration-test
except: [schedules]
needs: [build-android]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
tags:
- macos:sequoia
- specific:true
script:
- !reference [.pre, script]
- !reference [.pre-android, script]
- cd tools/ci && dart pub get && dart run ci_helpers start_sim --platform android --sdk $ANDROID_EMULATOR_SDK
- melos run integration_test:android
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
paths:
- tools/ci/logcat.txt
- .build/test-results/*_android_integration.jsonl
ios-integration-test:
extends: .tart-runner
stage: integration-test
except: [schedules]
needs: [build-ios]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- !reference [.pre-ios, script]
- pod repo update
- melos pub:get
- melos remove_podfile_lock --no-select
- melos run integration_test:ios
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
macos-integration-test:
stage: integration-test
except: [ schedules ]
needs: [ build-macos-spm ]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
tags:
- macos:sequoia
- specific:true
script:
- !reference [.pre, script]
- !reference [.pre-macos, script]
- flutter config --enable-swift-package-manager
- melos remove_cocoapods
- melos pub:get
- melos run integration_test:macos
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
web-integration-test:
stage: integration-test
except: [schedules]
needs: [build-web]
image: $CI_IMAGE_DOCKER
tags:
- "arch:amd64"
script:
- !reference [.pre, script]
- !reference [.pre-web, script]
- ./tools/ci/.tmp/chromedriver-linux64/chromedriver --port=4444 &
- melos run integration_test:web
linux-integration-test:
stage: integration-test
except: [ schedules ]
needs: [ build-linux ]
image: $CI_IMAGE_DOCKER
tags:
[ "arch:amd64" ]
script:
- !reference [.pre, script]
- xvfb-run -a dbus-run-session -- melos run integration_test:linux
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
# Windows integration tests require an AMI that can run UI, which is currently unavailable.
# Add this back if CIEXE-2284 is solved.
#
# windows-integration-test:
# stage: integration-test
# except: [ schedules ]
# needs: [ build-windows ]
# tags: [ "windows-v2:2022" ]
# variables:
# OVERRIDE_GIT_STRATEGY: clone # Required for Windows runners
# script:
# - $ErrorActionPreference = "Stop"
# - >
# docker run --rm
# -v "$(Get-Location):C:\mnt"
# -w C:\mnt
# ${env:WINDOWS_CI_IMAGE_DOCKER}
# powershell -File C:\mnt\ci\windows\ci-integration-test.ps1 -DdClientToken ${env:DD_CLIENT_TOKEN} -DdApplicationId ${env:DD_APPLICATION_ID}
# - If ($LASTEXITCODE -ne "0") { throw "docker run (integration test) returned $LASTEXITCODE" }
# artifacts:
# when: always
# expire_in: "30 days"
# reports:
# junit: $CI_PROJECT_DIR/.build/test-results/*.xml
# Release
#
# Manual job only -- never runs automatically off a plain branch push. The three
# `rules:` clauses below are the mainline/patch/pre-release trigger contexts;
# RELEASE_TRIGGER carries the matching --trigger value to the script, because
# prepare_release.dart's own branch auto-detection doesn't know about the
# pre-release whitelist. It defaults to `mainline`; the `develop` clause leaves
# that default alone so a manual run can set RELEASE_TRIGGER=prerelease to cut
# a pre-release from `develop`.
#
# Pre-release branches are a manually-maintained whitelist, not a pattern
# match -- add/remove an `if:` clause per active effort (see `v4` below); its
# release-prep PR targets `<branch>-main`. Keep in sync with
# .github/chainguard/self.prepare-release.sts.yaml's subject_pattern, which
# grants this job's GitHub token and is scoped to the same branch set, and
# with `preReleaseBranches` in tools/releaser/lib/publish_rules.dart.
prepare-release:
stage: prepare-release
rules:
# push-only: matches self.prepare-release.sts.yaml's trust policy.
# allow_failure: true: `when: manual` under `rules:` defaults to
# blocking, which would hold up `post`/`post-nightly` on every push.
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH =~ /^release\/[^\/]+\/v\d+(\.\d+)?\.x$/'
when: manual
allow_failure: true
variables:
RELEASE_TRIGGER: "support"
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "v4"' # pre-release whitelist -- see comment above
when: manual
allow_failure: true
variables:
RELEASE_TRIGGER: "prerelease"
variables:
# Full history + tags -- release planning walks back to old release
# tags, which a shallow clone may not have.
GIT_DEPTH: "0"
VAULT_ADDR: "https://vault.us1.ddbuild.io"
RELEASE_TRIGGER: "mainline"
PACKAGES: ""
# "false" releases only the packages named in PACKAGES; otherwise naming
# a member of a federated group also considers its siblings.
INCLUDE_FEDERATED: "true"
IOS_SDK_VERSION: ""
ANDROID_SDK_VERSION: ""
CPP_VERSION: ""
BUMP_TYPE: ""
PRERELEASE_LABEL: ""
id_tokens:
DDOCTOSTS_ID_TOKEN:
aud: dd-octo-sts
tags:
- macos:sequoia
- specific:true
before_script:
# We need a short-lived GitHub token to push commits and open PRs; see
# .github/chainguard/self.prepare-release.sts.yaml.
- dd-octo-sts --disable-tracing debug --scope DataDog/dd-sdk-flutter --policy self.prepare-release
- dd-octo-sts --disable-tracing token --scope DataDog/dd-sdk-flutter --policy self.prepare-release > /tmp/gh-token.txt
script:
- !reference [.pre, script]
# Runner checks out $CI_COMMIT_SHA detached; prepare_release.dart needs
# a real branch checkout. -B (not plain checkout) resets the branch to
# $CI_COMMIT_SHA even if this runner is reused and already has a local
# ref for it from a prior run.
- git checkout -B "$CI_COMMIT_BRANCH" "$CI_COMMIT_SHA"
# The `gh` CLI (github_cmd_wrapper.dart) picks up GITHUB_TOKEN automatically;
# for `git` push/PR-base operations we point origin at GitHub using the same
# token, and configure the dd-octo-sts bot identity for the release commits.
- export GITHUB_TOKEN=$(cat /tmp/gh-token.txt)
- git config user.name "dd-octo-sts[bot]"
- git config user.email "200755185+dd-octo-sts[bot]@users.noreply.github.com"
- git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/DataDog/dd-sdk-flutter.git"
# This repo requires signed commits (see CONTRIBUTING.md), so the
# release-prep commits need commit-headless too.
- commit-headless version
# AI Gateway token for LLM changelog generation, via authanywhere;
# ai_gateway.dart reads this env var directly (see
# HttpAiGatewayClient.fromEnvironment).
- export AI_GATEWAY_TOKEN=$(authanywhere --audience rapid-ai-platform --raw --dc us1.ddbuild.io)
- pushd tools/releaser && dart pub get && popd
- |
if [ "$INCLUDE_FEDERATED" = "false" ]; then
FEDERATED_FLAG="--no-include-federated"
else
FEDERATED_FLAG="--include-federated"
fi
- >
dart run tools/releaser/bin/prepare_release.dart
--repo-root=$CI_PROJECT_DIR
--trigger=$RELEASE_TRIGGER
--commit-headless
$FEDERATED_FLAG
${PACKAGES:+"--packages=$PACKAGES"}
${BUMP_TYPE:+"--bump-type=$BUMP_TYPE"}
${IOS_SDK_VERSION:+"--ios-sdk-version=$IOS_SDK_VERSION"}
${ANDROID_SDK_VERSION:+"--android-sdk-version=$ANDROID_SDK_VERSION"}
${CPP_VERSION:+"--cpp-version=$CPP_VERSION"}
${PRERELEASE_LABEL:+"--prerelease-label=$PRERELEASE_LABEL"}
after_script:
# Revoke the dd-octo-sts-provided GitHub token unconditionally once finished.
- dd-octo-sts --disable-tracing revoke --token "$(cat /tmp/gh-token.txt)"
# Phase 2 trigger
#
# Pushes the `release-trigger/*` tag that GitHub Actions' publish-release.yml
# watches for -- only after this exact commit's pipeline has already
# succeeded.
#
# Fires on every push to a release branch: `main`, a whitelisted pre-release
# `-main` branch (currently just `v4-main`, mirroring prepare-release's own
# `v4` whitelist -- never a wildcard), or a support branch. Most pushes to a support branch are ordinary cherry-picked
# fixes rather than releases, so the trigger can't tell them apart here;
# publish_release.dart does, by requiring the commit to be the merge of a
# `release-prep/*` PR, and exits without doing anything otherwise.
push-release-trigger-tag:
stage: release-trigger
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "v4-main")'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH =~ /^release\/[^\/]+\/v\d+(\.\d+)?\.x$/'
# Same runner as prepare-release as
# dd-octo-sts/git/gh all need to be present
tags:
- macos:sequoia
- specific:true
id_tokens:
DDOCTOSTS_ID_TOKEN:
aud: dd-octo-sts
before_script:
# Narrower scope than prepare-release's policy -- tag-push only, never
# PR/branch. See .github/chainguard/self.tag-push.sts.yaml.
- dd-octo-sts --disable-tracing debug --scope DataDog/dd-sdk-flutter --policy self.tag-push
- dd-octo-sts --disable-tracing token --scope DataDog/dd-sdk-flutter --policy self.tag-push > /tmp/gh-token.txt
script:
- export GITHUB_TOKEN=$(cat /tmp/gh-token.txt)
- git config user.name "dd-octo-sts[bot]"
- git config user.email "200755185+dd-octo-sts[bot]@users.noreply.github.com"
- git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/DataDog/dd-sdk-flutter.git"
- TAG_NAME="release-trigger/$(date -u +%Y-%m-%d)-${CI_COMMIT_SHORT_SHA}"
- git tag -a -m "$TAG_NAME" "$TAG_NAME" "$CI_COMMIT_SHA"
- git push origin "$TAG_NAME"
after_script:
- dd-octo-sts --disable-tracing revoke --token "$(cat /tmp/gh-token.txt)"
# Notify
notify-publish-develop-failure:
extends: .slack-notifier-base
stage: post
when: on_failure
only:
- develop
script:
- BUILD_URL="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID"
- 'MESSAGE_TEXT=":status_alert: $CI_PROJECT_NAME $CI_COMMIT_TAG develop pipeline <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"
notify-pipeline-succeeded:
stage: post
tags: ["arch:amd64"]
image: "$BUILDENV_REGISTRY/docker:24.0.4-jammy"
when: on_success
except:
- schedules
script:
- echo "Pipeline did succeed"
notify-nightly-failed:
extends: .slack-notifier-base
stage: post-nightly
when: on_failure
only:
- develop
- schedules
script:
- BUILD_URL="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID"
- 'MESSAGE_TEXT=":status_alert: $CI_PROJECT_NAME $CI_COMMIT_TAG Nightly develop pipeline <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"
# Nightly
.nightly-vars:
script:
# Tart VMs obtain AWS credentials through the AWS CLI config rather than env vars, which `vault login -method=aws` needs
- |
if [ -z "${AWS_ACCESS_KEY_ID:-}" ] || [ -z "${AWS_SECRET_ACCESS_KEY:-}" ]; then
aws_env="$(aws configure export-credentials --format env)"
eval "$aws_env"
fi
- vault login -method=aws -no-print
- export DD_E2E_CLIENT_TOKEN=$(vault kv get -field=client_token kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-flutter/e2e)
- export DD_E2E_APPLICATION_ID=$(vault kv get -field=application_id kv/aws/arn:aws:iam::486234852809:role/ci-dd-sdk-flutter/e2e)
.nightly:
only: [schedules]
when: always
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
tags:
- macos:sequoia
- specific:true
nightly-min-version-test:
extends: [.nightly, .tart-runner]
stage: version-test
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- !reference [.pre-ios, script]
- fvm install $FLUTTER_MIN_VERSION
- fvm use $FLUTTER_MIN_VERSION
- fvm exec dart pub global activate melos
- export MELOS_PACKAGES="datadog_flutter_plugin"
- fvm exec melos pub:get
- fvm exec melos analyze:dart
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
nightly-beta-test:
extends: [.nightly, .tart-runner]
stage: version-test
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- !reference [.pre-ios, script]
- !reference [.install-gradle-mirror, script]
- fvm destroy
- fvm install beta
- fvm use beta
- fvm flutter upgrade --force
- fvm flutter precache --ios
- fvm exec dart pub global activate melos
- pod repo update
- flutter doctor
- fvm exec melos pub:get
- fvm exec melos remove_podfile_lock --no-select
- fvm exec melos run analyze
- fvm exec melos run build
- fvm exec melos run unit_test:flutter
- fvm exec melos run unit_test:android
- fvm exec melos run unit_test:ios
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
nightly-beta-test-web:
extends: .nightly
stage: version-test
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
image: $CI_IMAGE_DOCKER
tags:
- "arch:amd64"
script:
- !reference [.pre, script]
- !reference [.pre-web, script]
- git -C "$(dirname $(dirname $(which flutter)))" reset --hard
- flutter channel beta
- flutter upgrade --force
- dart pub global activate melos
- flutter doctor
- melos pub:get
- melos run analyze:dart
- melos run build:web
- melos run unit_test:web
- melos run unit_test:openfeature-web
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
nightly-ios:
extends: [.nightly, .tart-runner]
stage: e2e-test
script:
- !reference [.nightly-vars, script]
- !reference [.pre, script]
- !reference [.pre-ios, script]
- pod repo update
- melos pub:get
- melos remove_podfile_lock --no-select
- melos run e2e_tests:ios
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
nightly-android:
extends: .nightly
stage: e2e-test
script:
- !reference [.nightly-vars, script]
- !reference [.pre, script]
- !reference [.pre-android, script]
- cd tools/ci && dart pub get && dart run ci_helpers start_sim --platform android --sdk $ANDROID_EMULATOR_SDK
- melos run e2e_tests:android
artifacts:
when: always
expire_in: "30 days"
reports:
junit: $CI_PROJECT_DIR/.build/test-results/*.xml
paths:
- tools/ci/logcat.txt
# Verify the published Dart floor with the repository's Flutter version manager.
openfeature-min-version-test:
extends: .tart-runner
stage: build
except: [schedules]
variables:
VAULT_ADDR: "https://vault.us1.ddbuild.io"
script:
- !reference [.pre, script]
- fvm install $FLUTTER_MIN_VERSION
- fvm use $FLUTTER_MIN_VERSION
- cd packages/datadog_flags
- fvm exec dart pub get
- fvm exec dart analyze .
- fvm exec dart test
- cd ../../tools/openfeature_conformance
- fvm exec dart pub get
- fvm exec dart analyze .
- fvm exec dart test