forked from DataDog/dd-sdk-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitrise.yml
More file actions
239 lines (228 loc) · 8.46 KB
/
Copy pathbitrise.yml
File metadata and controls
239 lines (228 loc) · 8.46 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
---
format_version: '8'
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_any_branch:
after_run:
- _make_dependencies
- run_linter
- run_unit_tests
- run_integration_tests
- check_dependency_managers
- _deploy_artifacts
push_to_dogfooding:
after_run:
- create_dogfooding_pr
_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: {}
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
- swiftlint@0.8.0:
title: Lint Sources/*
inputs:
- strict: 'yes'
- lint_config_file: "$BITRISE_SOURCE_DIR/tools/lint/sources.swiftlint.yml"
- linting_path: "$BITRISE_SOURCE_DIR"
- reporter: emoji
- swiftlint@0.8.0:
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
- script:
title: Verify RUM data models
is_always_run: true
inputs:
- content: |-
#!/usr/bin/env zsh
set -e
make rum-models-verify ci=${CI}
run_unit_tests:
description: |-
Runs unit tests for SDK on iOS Simulator.
Runs benchmarks for SDK on iOS Simulator.
Runs unit tests for HTTPServerMock package on macOS.
steps:
- xcode-test:
title: Run unit tests for Datadog - iOS Simulator
inputs:
- scheme: Datadog
- simulator_device: iPhone 11
- is_clean_build: 'yes'
- should_retry_test_on_fail: 'yes' # temporarily mutes flakiness until we collect more info (in RUMM-839) then fix it
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/Datadog-unit-tests.html"
- xcode-test:
title: Run unit tests for DatadogCrashReporting - iOS Simulator
inputs:
- scheme: DatadogCrashReporting
- simulator_device: iPhone 11
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogCrashReporting-unit-tests.html"
- xcode-test:
title: Run benchmarks - DatadogBenchmarkTests on iOS Simulator
inputs:
- scheme: DatadogBenchmarkTests
- simulator_device: iPhone 11
- 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}/Benchmark-tests.html"
- script:
title: Generate HTTPServerMock.xcodeproj
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make xcodeproj-httpservermock
- xcode-test-mac:
title: Run unit tests for HTTPServerMock.xcodeproj - macOS
inputs:
- scheme: HTTPServerMock-Package
- destination: platform=OS X,arch=x86_64
- project_path: instrumented-tests/http-server-mock/HTTPServerMock.xcodeproj
run_integration_tests:
description: |-
Runs integration tests from Datadog.xcworkspace.
steps:
- xcode-test:
title: Run integration tests for RUM, Logging and Tracing (on iOS Simulator)
inputs:
- scheme: DatadogIntegrationTests
- simulator_device: iPhone 11
- should_build_before_test: 'no'
- is_clean_build: 'no'
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcodebuild_test_options: -testPlan DatadogIntegrationTests
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogIntegration-tests.html"
- xcode-test:
title: Run integration tests for Crash Reporting (on iOS Simulator)
inputs:
- scheme: DatadogIntegrationTests
- simulator_device: iPhone 11
- should_build_before_test: 'no'
- is_clean_build: 'no'
- generate_code_coverage_files: 'yes'
- project_path: Datadog.xcworkspace
- xcodebuild_test_options: -testPlan DatadogCrashReportingIntegrationTests
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/DatadogCrashReportingIntegration-tests.html"
check_dependency_managers:
description: |-
Uses supported dependency managers to fetch, install and link the SDK
to test projects.
steps:
- script:
title: Test SPM compatibility
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-spm ci=${CI}
- xcodebuild:
title: Build SPMProject for tests - Catalyst
inputs:
- scheme: SPMProject
- destination: platform=macOS,variant=Mac Catalyst
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/spm/SPMProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/SPMProject-catalyst-sanity-check.html"
- xcode-test:
title: Run SPMProject tests
inputs:
- scheme: SPMProject
- simulator_device: iPhone 11
- 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-tests.html"
- script:
# Carthage doesn't support Catalyst, so we don't test CTProject for `variant=Mac Catalyst`
title: Test Carthage compatibility
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-carthage ci=${CI}
- xcode-test:
title: Run CTProject tests
inputs:
- scheme: CTProject
- simulator_device: iPhone 11
- 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-tests.html"
- script:
title: Test Cocoapods compatibility
inputs:
- content: |-
#!/usr/bin/env bash
set -e
make test-cocoapods ci=${CI}
- xcodebuild:
title: Build CPProject for tests - Catalyst
inputs:
- scheme: CPProject
- destination: platform=macOS,variant=Mac Catalyst
- project_path: "$BITRISE_SOURCE_DIR/dependency-manager-tests/cocoapods/CPProject.xcodeproj"
- xcpretty_test_options: --color --report html --output "${BITRISE_DEPLOY_DIR}/CPProject-catalyst-sanity-check.html"
- xcode-test:
title: Run CPProject tests
inputs:
- scheme: CPProject
- simulator_device: iPhone 11
- 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-tests.html"
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 bash
set -e
make dogfood ci=${CI}