Repository navigation
Expand file tree
/
Copy pathbitrise.yml
More file actions
428 lines (399 loc) · 13.1 KB
/
Copy pathbitrise.yml
File metadata and controls
428 lines (399 loc) · 13.1 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
format_version: 7
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR
workflows:
# ----------------------------------------------------------------
# --- workflow to Step Test
ci:
before_run:
- audit-this-step
steps:
- go-list:
- golint:
- errcheck:
- go-test:
after_run:
# headless tests first, as otherwise running emulator is reused
- ci-objc_headless_mode
- _script_wrapper_for_headless_failing_ui_test
- ci-objc_headless_mode_xcpretty
- ci-parallel_headless_mode
- tvos_headless_mode
- ci-objc
- ci-parallel
- tvos
manual_test-retry_after_fail:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-ios-simple-objc-with-uitest.git
- SAMPLE_APP_BRANCH: failing-ui-test
- OUTPUT_TOOL: xcpretty
- BITRISE_PROJECT_PATH: ios-simple-objc/ios-simple-objc.xcodeproj
- BITRISE_SCHEME: ios-simple-objc
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "yes"
after_run:
- _test
- check_exported_artifacts
xcode_8_ci:
before_run:
- audit-this-step
steps:
- go-list:
- go-test:
after_run:
- ci-xcode-8_headless_mode
- ci-xcode-8
ci-objc_headless_mode:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-ios-simple-objc-with-uitest.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: ios-simple-objc/ios-simple-objc.xcodeproj
- BITRISE_SCHEME: ios-simple-objc
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "no"
after_run:
- _test
- check_exported_artifacts
ci-objc_headless_mode_xcpretty:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-ios-simple-objc-with-uitest.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcpretty
- BITRISE_PROJECT_PATH: ios-simple-objc/ios-simple-objc.xcodeproj
- BITRISE_SCHEME: ios-simple-objc
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "no"
after_run:
- _test
- check_exported_artifacts
- check_xcpretty_html_report
_script_wrapper_for_headless_failing_ui_test:
steps:
- script:
title: Start a failing workflow, wrapped in a script.
inputs:
- content: |-
#!/bin/env bash
bitrise run ci-objc_headless_mode_failing_ui_test
if [ $? -ne 1 ] ; then
echo "Workflow was excepted to fail, exit code not 1."
exit 1
fi
ci-objc_headless_mode_failing_ui_test:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-ios-simple-objc-with-uitest.git
- SAMPLE_APP_BRANCH: failing-ui-test
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: ios-simple-objc/ios-simple-objc.xcodeproj
- BITRISE_SCHEME: ios-simple-objc
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "no"
after_run:
- _test
- check_exported_artifacts
ci-xcode-8_headless_mode:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/ios-xcode-8.0.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: ios-xcode-8.0/ios-xcode-8.0.xcodeproj
- BITRISE_SCHEME: ios-xcode-8.0
- SIMULATOR_DEVICE: iPhone 6 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "no"
after_run:
- _test
tvos_headless_mode:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-tvos-swift.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: NPO Live.xcworkspace
- BITRISE_SCHEME: NPO Live
- SIMULATOR_DEVICE: Apple TV
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: tvOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "no"
after_run:
- _test
ci-parallel_headless_mode:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: BullsEye.xcodeproj
- BITRISE_SCHEME: BullsEye
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "yes"
- RETRY_ON_FAIL: "no"
after_run:
- _test
ci-objc:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-ios-simple-objc-with-uitest.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: ios-simple-objc/ios-simple-objc.xcodeproj
- BITRISE_SCHEME: ios-simple-objc
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "no"
- RETRY_ON_FAIL: "no"
after_run:
- _test
- check_exported_artifacts
ci-xcode-8:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/ios-xcode-8.0.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: ios-xcode-8.0/ios-xcode-8.0.xcodeproj
- BITRISE_SCHEME: ios-xcode-8.0
- SIMULATOR_DEVICE: iPhone 6 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "no"
- RETRY_ON_FAIL: "no"
after_run:
- _test
tvos:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-tvos-swift.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: NPO Live.xcworkspace
- BITRISE_SCHEME: NPO Live
- SIMULATOR_DEVICE: Apple TV
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: tvOS Simulator
- HEADLESS_MODE: "no"
- RETRY_ON_FAIL: "no"
after_run:
- _test
ci-parallel:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: BullsEye.xcodeproj
- BITRISE_SCHEME: BullsEye
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_OS_VERSION: latest
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "no"
- RETRY_ON_FAIL: "no"
after_run:
- _test
_test:
steps:
- script:
inputs:
- content: |-
#!/bin/env bash
set -e
set -v
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- script:
inputs:
- content: |-
#!/bin/env bash
echo BITRISE_SOURCE_DIR: ${BITRISE_SOURCE_DIR}
echo ORIG_BITRISE_SOURCE_DIR: ${ORIG_BITRISE_SOURCE_DIR}
echo working directory: $(pwd)
- script:
inputs:
- content: |-
#!/bin/env bash
set -e
set -v
git clone -b $SAMPLE_APP_BRANCH --single-branch $SAMPLE_APP_URL .
- certificate-and-profile-installer: {}
- path::./:
inputs:
- output_tool: $OUTPUT_TOOL
- is_clean_build: "yes"
- should_retry_test_on_fail: $RETRY_ON_FAIL
- generate_code_coverage_files: "no"
- simulator_device: $SIMULATOR_DEVICE
- simulator_os_version: $SIMULATOR_OS_VERSION
- simulator_platform: $SIMULATOR_PLATFORM
- should_build_before_test: "yes"
- xcodebuild_test_options: -verbose
- export_uitest_artifacts: "true"
- verbose: "yes"
- headless_mode: $HEADLESS_MODE
- script:
title: Output test
is_always_run: true
inputs:
- content: |-
echo "BITRISE_XCODE_TEST_RESULT: ${BITRISE_XCODE_TEST_RESULT}"
if [ ! -f "$BITRISE_XCODE_RAW_TEST_RESULT_TEXT_PATH" ] ; then
echo "No BITRISE_XCODE_RAW_TEST_RESULT_TEXT_PATH file generated!"
exit 1
fi
if [ ! -d $BITRISE_XCRESULT_PATH ]; then
echo "Xcode results not found in $BITRISE_XCRESULT_PATH"
exit 1
fi
# Check and REMOVE test-info.json
if [ $(find ${BITRISE_TEST_DEPLOY_DIR} -type f -delete -print -regex "${BITRISE_TEST_DEPLOY_DIR}/.*/${BITRISE_SCHEME}/test-info\.json" | grep -q .) ]; then
echo "${BITRISE_TEST_DEPLOY_DIR} does not contain test-info.json."
exit 1
fi
echo "BITRISE_XCODE_RAW_TEST_RESULT_TEXT_PATH: ${BITRISE_XCODE_RAW_TEST_RESULT_TEXT_PATH}"
echo "BITRISE_XCODE_TEST_ATTACHMENTS_PATH: ${BITRISE_XCODE_TEST_ATTACHMENTS_PATH}"
echo "BITRISE_XCRESULT_PATH: $BITRISE_XCRESULT_PATH"
echo "BITRISE_TEST_DEPLOY_DIR: $BITRISE_TEST_DEPLOY_DIR"
- change-workdir:
title: Switch back to work dir at the start.
inputs:
- path: ${ORIG_BITRISE_SOURCE_DIR}
check_exported_artifacts:
steps:
- script:
title: Exported attachment test
is_always_run: true
inputs:
- content: |-
#!/bin/env bash
set -e
version=`xcodebuild -version`
regex="Xcode ([0-9]*)."
if [[ $version =~ $regex ]]; then
if [[ ${BASH_REMATCH[1]} -ge 11 ]]; then
exit 0
fi
fi
if [ ! -f $BITRISE_DEPLOY_DIR/ios-simple-objc-xc-test-Attachments.zip ]; then
echo "Exported artifacts - ios-simple-objc-xc-test-Attachments.zip - not found in $BITRISE_DEPLOY_DIR"
exit 1
fi
echo "Exported attachments found: $BITRISE_DEPLOY_DIR/ios-simple-objc-xc-test-Attachments.zip"
check_xcpretty_html_report:
steps:
- script:
title: Check xcpretty html report
is_always_run: true
inputs:
- content: |-
#!/bin/env bash
set -e
if [ ! -f $BITRISE_DEPLOY_DIR/xcode-test-results-ios-simple-objc.html ]; then
echo "Exported xcpretty html report - xcode-test-results-ios-simple-objc.html - not found in $BITRISE_DEPLOY_DIR"
exit 1
fi
echo "Exported xcpretty html report found: $BITRISE_DEPLOY_DIR/xcode-test-results-ios-simple-objc.html"
ci-swiftpm:
envs:
- SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-ios-swiftpm.git
- SAMPLE_APP_BRANCH: master
- OUTPUT_TOOL: xcodebuild
- BITRISE_PROJECT_PATH: sample-swiftpm.xcodeproj
- BITRISE_SCHEME: "sample swiftpm"
- SIMULATOR_DEVICE: iPhone 8 Plus
- SIMULATOR_PLATFORM: iOS Simulator
- HEADLESS_MODE: "no"
- RETRY_ON_FAIL: "no"
steps:
- cache-pull: {}
- script:
inputs:
- content: |-
#!/bin/env bash
set -e
set -v
rm -rf ./_tmp
- change-workdir:
title: Switch working dir to test / _tmp dir
run_if: true
inputs:
- path: ./_tmp
- is_create_path: true
- script:
inputs:
- content: |-
#!/bin/env bash
echo BITRISE_SOURCE_DIR: ${BITRISE_SOURCE_DIR}
echo ORIG_BITRISE_SOURCE_DIR: ${ORIG_BITRISE_SOURCE_DIR}
echo working directory: $(pwd)
- script:
inputs:
- content: |-
#!/bin/env bash
set -e
set -v
git clone -b $SAMPLE_APP_BRANCH --single-branch $SAMPLE_APP_URL .
- certificate-and-profile-installer: {}
- path::./:
inputs:
- output_tool: $OUTPUT_TOOL
- is_clean_build: "no"
- should_retry_test_on_fail: $RETRY_ON_FAIL
- generate_code_coverage_files: "no"
- simulator_device: $SIMULATOR_DEVICE
- simulator_os_version: latest
- simulator_platform: $SIMULATOR_PLATFORM
- should_build_before_test: "no"
- xcodebuild_test_options: -verbose
- export_uitest_artifacts: "true"
- verbose: "yes"
- headless_mode: $HEADLESS_MODE
- cache_level: "swift_packages"
- change-workdir:
title: Switch back to work dir at the start.
inputs:
- path: ${ORIG_BITRISE_SOURCE_DIR}
- cache-push: {}
# ----------------------------------------------------------------
# --- Utility workflows
dep-update:
title: Dep update
description: |
Used for updating bitrise dependencies with dep
steps:
- script:
title: Dependency update
inputs:
- content: |-
#!/bin/env bash
set -ex
go get -u -v github.com/golang/dep/cmd/dep
dep ensure -v
dep ensure -v -update
# ----------------------------------------------------------------
# --- workflows to Share this step into a Step Library
audit-this-step:
steps:
- script:
inputs:
- content: |-
#!/bin/env bash
set -ex
stepman audit --step-yml ./step.yml