forked from DataDog/dd-sdk-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
624 lines (594 loc) · 23.9 KB
/
bitrise.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
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
format_version: 11
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: other
# To customize how workflows are run on different triggers,
# go to Workflow Editor on Bitrise.io.
workflows:
push_to_pull_request:
description: |-
This workflow is triggered on starting new PR or pushing new changes to existing PRs.
By default, it doesn't run any test phases, but this behaviour is overwritten in `choose_workflows.py` when:
- one or more `DD_OVERWRITE_RUN_(phase)_TESTS` ENVs are passed to the current CI job:
- DD_OVERRIDE_RUN_UNIT_TESTS='1' to run unit tests phase for the main SDK
- DD_OVERRIDE_RUN_SR_UNIT_TESTS='1' to run unit tests phase for Session Replay product
- DD_OVERRIDE_RUN_INTEGRATION_TESTS='1' to run integration tests phase
- DD_OVERRIDE_RUN_SMOKE_TESTS='1' to run smoke tests phase
- DD_OVERRIDE_RUN_TOOLS_TESTS='1' to run tools tests phase
- a phase is selected on the checklist in the PR description,
- the PR changes a file which matches phase filter (e.g. changing a file in `Sources/*` will trigger unit tests phase)
envs:
- DD_RUN_UNIT_TESTS: '0'
- DD_RUN_SR_UNIT_TESTS: '0'
- DD_RUN_INTEGRATION_TESTS: '0'
- DD_RUN_SMOKE_TESTS: '0'
- DD_RUN_TOOLS_TESTS: '0'
after_run:
- _make_dependencies
- run_conditioned_workflows
- _deploy_artifacts
push_to_develop_or_master:
description: |-
This workflow is triggered for each new commit pushed to `develop` or `master` branch.
envs:
- DD_RUN_UNIT_TESTS: '1'
- DD_RUN_SR_UNIT_TESTS: '1'
- DD_RUN_INTEGRATION_TESTS: '1'
- DD_RUN_SMOKE_TESTS: '0'
- DD_RUN_TOOLS_TESTS: '0'
after_run:
- _make_dependencies
- run_conditioned_workflows
- _deploy_artifacts
- _notify_failure_on_slack
run_nightly_smoke_and_tools_tests:
description: |-
This workflow is triggered every night.
envs:
- DD_RUN_UNIT_TESTS: '0'
- DD_RUN_SR_UNIT_TESTS: '0'
- DD_RUN_INTEGRATION_TESTS: '0'
- DD_RUN_SMOKE_TESTS: '1'
- DD_RUN_TOOLS_TESTS: '1'
after_run:
- _make_dependencies
- run_conditioned_workflows
- _deploy_artifacts
- _notify_failure_on_slack
push_to_dogfooding:
after_run:
- create_dogfooding_pr
- _notify_failure_on_slack
run_nightly_e2e_tests:
after_run:
- _make_dependencies
- run_e2e_tests
- _notify_failure_on_slack
tagged_commit:
description: |-
This workflow is triggered on pushing a new release tag.
envs:
- DD_RUN_UNIT_TESTS: '1'
- DD_RUN_SR_UNIT_TESTS: '1'
- DD_RUN_INTEGRATION_TESTS: '1'
- DD_RUN_SMOKE_TESTS: '1'
- DD_RUN_TOOLS_TESTS: '0'
after_run:
- _make_dependencies
- run_conditioned_workflows
- _deploy_artifacts
- start_async_release_jobs
- _notify_failure_on_slack
_make_dependencies:
description: |-
Does `make dependencies` to prepare source code in repo for building and testing.
steps:
- script:
title: Do `make dependencies`
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make dependencies ci=${CI}
_deploy_artifacts:
description: |-
Uploads artifacts to associate them with build log on Bitrise.io.
steps:
- deploy-to-bitrise-io: {}
_notify_failure_on_slack:
description: |-
Notifies any (previous) workflow failure on Slack.
Should be used to notify failures for workflows which do not report back to GitHub check.
steps:
- slack:
is_always_run: true
run_if: .IsBuildFailed
inputs:
- channel: '#dd-sdk-ios'
- buttons: |-
See Bitrise log|${BITRISE_BUILD_URL}
- pretext: |-
⚠️ Bitrise build failed.
- color_on_error: '#FF0000'
- author_name: ''
- message: ''
- message_on_error: 'Failed to run "${BITRISE_TRIGGERED_WORKFLOW_ID}"'
- icon_url: 'https://avatars.githubusercontent.com/t/3555052?s=128&v=4'
- webhook_url: '${SLACK_INCOMING_WEBHOOK_MOBILE_CI}'
run_conditioned_workflows:
steps:
- script:
title: Choose which workflows to run
inputs:
- content: |-
#!/usr/bin/env bash
cd tools/ci && make
# The `choose_workflows.py` inspects current ENV variables and Pull Request metadata (if running in PR)
# and decides on which from the workflows in `after_run` should be ran. Workflows are opted-in
# by modifying `DD_RUN_*` ENV variables with `envman` (ref.: https://github.com/bitrise-io/envman).
venv/bin/python3 choose_workflows.py
after_run:
- run_linter
- run_unit_tests
- run_integration_tests
- run_smoke_tests
- run_tools_tests
run_linter:
description: |-
Runs swiftlint and license check for all source and test files.
steps:
- script:
title: Patch linter configuration for swiftlint 0.42.0
inputs:
- content: |-
#!/usr/bin/env bash
set -e
./tools/lint/patch_if_swiftlint_0.42.0.sh
title: Lint Sources/*
inputs:
- strict: 'yes'
- lint_config_file: "$BITRISE_SOURCE_DIR/tools/lint/sources.swiftlint.yml"
- linting_path: "$BITRISE_SOURCE_DIR"
- reporter: emoji
title: Lint Tests/*
is_always_run: true
inputs:
- strict: 'yes'
- linting_path: "$BITRISE_SOURCE_DIR"
- lint_config_file: "$BITRISE_SOURCE_DIR/tools/lint/tests.swiftlint.yml"
- reporter: emoji
- script:
title: Check license headers
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env bash
set -e
./tools/license/check-license.sh
run_unit_tests:
description: |-
Runs unit tests for SDK on iOS Simulator.
Runs unit tests for SDK on tvOS Simulator.
Selectively runs:
- main SDK tests when 'DD_RUN_UNIT_TESTS' is '1'
- or Session Replay tests when when 'DD_RUN_SR_UNIT_TESTS' is '1'
steps:
- script:
title: Verify RUM data models
run_if: '{{enveq "DD_RUN_UNIT_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
make rum-models-verify ci=${CI}
- script:
title: Verify SR data models
run_if: '{{enveq "DD_RUN_SR_UNIT_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
make sr-models-verify ci=${CI}
- xcode-test:
title: Run unit tests for Datadog - iOS Simulator
run_if: '{{enveq "DD_RUN_UNIT_TESTS" "1"}}'
inputs:
- scheme: DatadogCore iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- is_clean_build: 'yes'
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/Datadog-ios-unit-tests.html"
- xcode-test:
title: Run unit tests for DatadogCrashReporting - iOS Simulator
run_if: '{{enveq "DD_RUN_UNIT_TESTS" "1"}}'
inputs:
- scheme: DatadogCrashReporting iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogCrashReporting-ios-unit-tests.html"
- xcode-test:
title: Run unit tests for Datadog - tvOS Simulator
run_if: '{{enveq "DD_RUN_UNIT_TESTS" "1"}}'
inputs:
- scheme: DatadogCore tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- is_clean_build: 'yes'
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/Datadog-tvos-unit-tests.html"
- xcode-test:
title: Run unit tests for DatadogCrashReporting - tvOS Simulator
run_if: '{{enveq "DD_RUN_UNIT_TESTS" "1"}}'
inputs:
- scheme: DatadogCrashReporting tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogCrashReporting-tvos-unit-tests.html"
- xcode-test:
title: Run unit tests for Session Replay - iOS Simulator
run_if: '{{enveq "DD_RUN_SR_UNIT_TESTS" "1"}}'
inputs:
- scheme: DatadogSessionReplay iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- should_build_before_test: 'no'
- is_clean_build: 'no'
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogSessionReplay-ios-unit-tests.html"
- script:
title: Pull Session Replay snapshots
run_if: '{{enveq "DD_RUN_SR_UNIT_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
make sr-pull-snapshots
- script:
title: Configure SRSnapshotTests project launch
run_if: '{{enveq "DD_RUN_SR_UNIT_TESTS" "1"}}'
inputs:
- content: |
#!/usr/bin/env zsh
# The `SRSnapshotTests.xcworkspace` depends on `dd-sdk-ios/Package.swift` but requires the `dd-sdk-ios/TestUtilities` library,
# which is not defined statically in the root package. To add it dynamically, we leverage the `DD_TEST_UTILITIES_ENABLED` ENV
# variable respected by the main package. Here we export it so it is available in next CI steps:
envman add --key DD_TEST_UTILITIES_ENABLED --value '1'
- xcode-test:
title: Run snapshot tests for Session Replay - iOS Simulator
run_if: '{{enveq "DD_RUN_SR_UNIT_TESTS" "1"}}'
inputs:
- scheme: SRSnapshotTests
- destination: platform=iOS Simulator,name=iPhone 14,OS=16.2
- should_build_before_test: 'no'
- is_clean_build: 'no'
- generate_code_coverage_files: 'yes'
- project_path: DatadogSessionReplay/SRSnapshotTests/SRSnapshotTests.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogSessionReplay-snapshot-tests.html"
run_integration_tests:
description: |-
Build benchmarks for SDK on iOS Simulator.
Runs integration tests from Datadog.xcworkspace.
Only ran if 'DD_RUN_INTEGRATION_TESTS' is '1'.
steps:
- script:
title: Prepare Integration Tests
run_if: '{{enveq "DD_RUN_INTEGRATION_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
make prepare-integration-tests
./tools/config/generate-http-server-mock-config.sh
- xcode-test:
title: Run integration tests for RUM, Logging, Tracing and SR (on iOS Simulator)
run_if: '{{enveq "DD_RUN_INTEGRATION_TESTS" "1"}}'
inputs:
- scheme: IntegrationScenarios
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- should_build_before_test: 'no'
- is_clean_build: 'no'
- generate_code_coverage_files: 'yes'
- project_path: IntegrationTests/IntegrationTests.xcworkspace
- xcodebuild_options: -testPlan DatadogIntegrationTests
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogIntegration-tests.html"
- script:
title: Disable Apple Crash Reporter
run_if: '{{enveq "DD_RUN_INTEGRATION_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env zsh
# We suspect Apple Crash Reporter causing flakiness in our CR integration tests.
# Disabling it makes the system prompt ("Example iOS quit unexpectedly") not appear.
launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
- xcode-test:
title: Run integration tests for Crash Reporting (on iOS Simulator)
run_if: '{{enveq "DD_RUN_INTEGRATION_TESTS" "1"}}'
inputs:
- scheme: IntegrationScenarios
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- should_build_before_test: 'no'
- is_clean_build: 'no'
- generate_code_coverage_files: 'yes'
- project_path: IntegrationTests/IntegrationTests.xcworkspace
- xcodebuild_options: -testPlan DatadogCrashReportingIntegrationTests
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogCrashReportingIntegration-tests.html"
run_smoke_tests:
description: |-
Uses supported dependency managers to fetch, install and link the SDK
to test projects.
Only ran if 'DD_RUN_SMOKE_TESTS' is '1'.
steps:
- script:
title: Test SPM compatibility
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-spm ci=${CI}
- script:
title: Check Mac Catalyst compatibility (build SPMProject for Catalyst)
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -euxo pipefail
xcodebuild build -scheme "App iOS" \
-project "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj" \
-destination "platform=macOS,variant=Mac Catalyst" \
| xcpretty
- xcode-test:
title: Run SPMProject iOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/SPMProject-ios-tests.html"
- xcode-test:
title: Run SPMProject tvOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/SPMProject-tvos-tests.html"
- script:
title: Test Carthage compatibility
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-carthage ci=${CI}
- xcode-test:
title: Run CTProject iOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/carthage/CTProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CTProject-ios-tests.html"
- xcode-test:
title: Run CTProject tvOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/carthage/CTProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CTProject-tvos-tests.html"
- script:
title: Test Cocoapods compatibility
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-cocoapods ci=${CI}
- xcode-test:
title: Run CPProject tests iOS with 'use_frameworks!'
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App Dynamic iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/cocoapods/CPProject.xcworkspace"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CPProject-ios-dynamic-tests.html"
- xcode-test:
title: Run CPProject tests iOS with no 'use_frameworks!'
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App Static iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/cocoapods/CPProject.xcworkspace"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CPProject-ios-static-tests.html"
- xcode-test:
title: Run CPProject tests tvOS with 'use_frameworks!'
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App Dynamic tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/cocoapods/CPProject.xcworkspace"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CPProject-tvos-dynamic-tests.html"
- xcode-test:
title: Run CPProject tests tvOS with no 'use_frameworks!'
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App Static tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/cocoapods/CPProject.xcworkspace"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CPProject-tvos-static-tests.html"
- script:
title: Test XCFrameworks compatibility
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-xcframeworks ci=${CI}
- xcode-test:
title: Run XCProject iOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App iOS
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/xcframeworks/XCProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/XCProject-ios-tests.html"
- xcode-test:
title: Run XCProject tvOS tests
run_if: '{{enveq "DD_RUN_SMOKE_TESTS" "1"}}'
inputs:
- scheme: App tvOS
- destination: platform=tvOS Simulator,name=Apple TV,OS=latest
- is_clean_build: 'yes'
- cache_level: none
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/xcframeworks/XCProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/XCProject-tvos-tests.html"
run_tools_tests:
description: |-
Runs tests for internal tools.
Only ran if 'DD_RUN_TOOLS_TESTS' is '1'.
steps:
- script:
title: Run unit tests for http-server-mock
run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
swift test --package-path instrumented-tests/http-server-mock
- script:
title: Run unit tests for rum-models-generator
run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
swift test --package-path tools/rum-models-generator
- script:
title: Run unit tests for sr-snapshots
run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
swift test --package-path tools/sr-snapshots
- script:
title: Run tests for distribution tools
run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
cd tools/distribution && make
venv/bin/python3 -m pytest tests
- script:
title: Run tests for nightly-unit-tests tool
run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}'
inputs:
- content: |-
#!/usr/bin/env bash
set -e
cd tools/nightly-unit-tests && make
venv/bin/python3 -m pytest tests
create_dogfooding_pr:
description: |-
Creates PRs to repositories using `dd-sdk-ios`.
steps:
- script:
title: Create PR to Datadog mobile app project
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
cd tools/distribution && make
venv/bin/python3 dogfood.py
run_e2e_tests:
description: |-
Runs E2E tests on iOS Simulator.
steps:
- xcode-test:
title: Run E2E tests for manual instrumentation APIs - iOS Simulator
inputs:
- scheme: E2ETests
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/E2E-tests.html"
- xcode-test:
title: Run E2E tests for auto instrumentation APIs - iOS Simulator
inputs:
- scheme: E2EInstrumentationTests
- destination: platform=iOS Simulator,name=iPhone 11,OS=latest
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/E2E-instrumentation-tests.html"
start_async_release_jobs:
description: |-
Spins off two parallel CI jobs for releasing the actual artifacts.
steps:
- build-router-start:
title: Start new CI jobs for running 'publish_github_asset' and 'publish_cocoapods_podspecs'.
inputs:
- access_token: "$BITRISE_PERSONAL_ACCESS_TOKEN"
- workflows: |-
publish_github_asset
publish_cocoapods_podspecs
- environment_key_list: |-
DD_RELEASE_GIT_TAG
DD_RELEASE_DRY_RUN
publish_github_asset:
before_run:
- _make_dependencies # install tooling
after_run:
- _notify_failure_on_slack
description: |-
Uploads binaries to Github.
steps:
- script:
title: Publish GH Asset.
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
# Use 'DD_RELEASE_GIT_TAG' ENV if available, otherwise 'BITRISE_GIT_TAG' ENV
GIT_TAG="${DD_RELEASE_GIT_TAG:-$(echo "${BITRISE_GIT_TAG}")}"
cd tools/distribution && make
venv/bin/python3 release.py "$GIT_TAG" --only-github
publish_cocoapods_podspecs:
before_run:
- _make_dependencies # install tooling
after_run:
- _notify_failure_on_slack
description: |-
Submits all podspecs to Cocoapods.
steps:
- script:
title: Submit podspecs to Cocoapods.
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
# Use 'DD_RELEASE_GIT_TAG' ENV if available, otherwise 'BITRISE_GIT_TAG' ENV
GIT_TAG="${DD_RELEASE_GIT_TAG:-$(echo "${BITRISE_GIT_TAG}")}"
cd tools/distribution && make
venv/bin/python3 release.py "$GIT_TAG" --only-cocoapods