Skip to content

Commit e241fba

Browse files
Make the iOS build scripts portable off GitHub Actions
Part of the macOS CI speed-up. Tracked on shop/issues-checkout-kit#1205, under shop/issues-checkout-kit#1202. Enabler only. This PR lands no measurable delta by itself. It removes three defects that would break the Bitrise port on contact. ## Problem 1. The Xcode build scripts key their `xcbeautify` renderer off `CI`, which is also `true` on Bitrise. Bitrise would get GitHub Actions annotation markup in its logs. 2. `xcbeautify` is assumed present in two scripts. `xcode_run:110` already guards it; the others do not. The Bitrise macOS stack does not ship it. 3. The existing `e2e` pipeline uses the default `status_report_name`, which is identical for every pipeline on a Bitrise app. A second pipeline would overwrite its commit status. ## Change - `platforms/swift/Scripts/xcode_run`, `platforms/swift/Scripts/api`, `platforms/react-native/sample/scripts/build_ios`, `platforms/react-native/sample/scripts/test_ios` — renderer keyed off `GITHUB_ACTIONS` rather than `CI`, plus a `run_xcodebuild()` wrapper and a `command -v xcbeautify` guard in the two scripts that lacked one. - `e2e/bitrise.yml` — the `e2e` pipeline gains a `status_report_name` containing `<target_id>`, and `nightly-decide-should-build` gains the `no_output_timeout` that `BITRISE.md:113` requires. ## Verification - `shadowenv exec -- bitrise validate --config=e2e/bitrise.yml` — valid. - `shadowenv exec -- ./scripts/test_ruby` — green. - `bash -n` on all four edited scripts — clean. ## Note for the author Two edits were not in the plan text and were found while porting: the `no_output_timeout` on `nightly-decide-should-build`, and the `GITHUB_ACTIONS` guard in `platforms/swift/Scripts/api`. Both are one line. Renaming the `e2e` pipeline's status report is safe. Ruleset 15994822 requires only `CI Required`, and `e2e/BITRISE.md:53` states the E2E GitHub checks are deliberately non-blocking.
1 parent ed20cc7 commit e241fba

5 files changed

Lines changed: 50 additions & 25 deletions

File tree

e2e/bitrise.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ trigger_map:
4242

4343
pipelines:
4444
e2e:
45+
# Bitrise's default report name is ci/bitrise/<project_slug>/<event_type>,
46+
# which is identical for every pipeline on this app. A second triggered
47+
# pipeline would then overwrite this one's commit status. <target_id>
48+
# expands to the pipeline id, so each pipeline owns its own check.
49+
status_report_name: "ci/bitrise/<target_id>/<event_type>"
4550
workflows:
4651
e2e-produce-browserstack-run-plan: {}
4752
e2e-build-react-native-ios:
@@ -451,6 +456,7 @@ workflows:
451456
- script@1:
452457
title: Decide whether the nightly build runs
453458
timeout: 300
459+
no_output_timeout: 150
454460
inputs:
455461
- content: |-
456462
set -euo pipefail

platforms/react-native/sample/scripts/build_ios

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,25 @@ dest="$(get_sim_destination)"
2525
cd ios
2626

2727
xcbeautify_args=""
28-
if [ "$CI" = "true" ]; then
28+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
2929
xcbeautify_args="--renderer github-actions"
3030
fi
3131

32-
xcodebuild clean build \
33-
-workspace CheckoutKitReactNativeDemo.xcworkspace \
34-
-scheme CheckoutKitReactNativeDemo \
35-
-sdk iphonesimulator \
36-
-destination "$dest" \
37-
-skipPackagePluginValidation \
38-
-disableAutomaticPackageResolution \
39-
GCC_PRECOMPILE_PREFIX_HEADER=YES \
40-
ASSETCATALOG_COMPILER_OPTIMIZATION=time \
41-
COMPILER_INDEX_STORE_ENABLE=NO \
42-
| xcbeautify $xcbeautify_args
32+
run_xcodebuild() {
33+
xcodebuild clean build \
34+
-workspace CheckoutKitReactNativeDemo.xcworkspace \
35+
-scheme CheckoutKitReactNativeDemo \
36+
-sdk iphonesimulator \
37+
-destination "$dest" \
38+
-skipPackagePluginValidation \
39+
-disableAutomaticPackageResolution \
40+
GCC_PRECOMPILE_PREFIX_HEADER=YES \
41+
ASSETCATALOG_COMPILER_OPTIMIZATION=time \
42+
COMPILER_INDEX_STORE_ENABLE=NO
43+
}
44+
45+
if command -v xcbeautify >/dev/null 2>&1; then
46+
run_xcodebuild | xcbeautify $xcbeautify_args
47+
else
48+
run_xcodebuild
49+
fi

platforms/react-native/sample/scripts/test_ios

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,24 @@ else
3535
fi
3636

3737
xcbeautify_args=""
38-
if [ "$CI" = "true" ]; then
38+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
3939
xcbeautify_args="--renderer github-actions"
4040
fi
4141

42-
xcodebuild test \
43-
-workspace RCTIntegrationApp.xcworkspace \
44-
-scheme RCTIntegrationApp \
45-
-destination "$dest" \
46-
-skipPackagePluginValidation \
47-
-disableAutomaticPackageResolution \
48-
-sdk iphonesimulator \
49-
ASSETCATALOG_COMPILER_OPTIMIZATION=time \
50-
COMPILER_INDEX_STORE_ENABLE=NO \
51-
| xcbeautify $xcbeautify_args
42+
run_xcodebuild() {
43+
xcodebuild test \
44+
-workspace RCTIntegrationApp.xcworkspace \
45+
-scheme RCTIntegrationApp \
46+
-destination "$dest" \
47+
-skipPackagePluginValidation \
48+
-disableAutomaticPackageResolution \
49+
-sdk iphonesimulator \
50+
ASSETCATALOG_COMPILER_OPTIMIZATION=time \
51+
COMPILER_INDEX_STORE_ENABLE=NO
52+
}
53+
54+
if command -v xcbeautify >/dev/null 2>&1; then
55+
run_xcodebuild | xcbeautify $xcbeautify_args
56+
else
57+
run_xcodebuild
58+
fi

platforms/swift/Scripts/api

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ build_for_digester() {
4141
SWIFT_TREAT_WARNINGS_AS_ERRORS=YES
4242
)
4343

44+
local xcbeautify_args=""
45+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
46+
xcbeautify_args="--renderer github-actions"
47+
fi
48+
4449
cd "$PACKAGE_ROOT"
4550
if command -v xcbeautify >/dev/null 2>&1; then
46-
"${cmd[@]}" | xcbeautify --renderer github-actions
51+
"${cmd[@]}" | xcbeautify $xcbeautify_args
4752
else
4853
"${cmd[@]}"
4954
fi

platforms/swift/Scripts/xcode_run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fi
109109

110110
if command -v xcbeautify >/dev/null 2>&1; then
111111
xcbeautify_args=""
112-
if [ "$CI" = "true" ]; then
112+
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
113113
xcbeautify_args="--renderer github-actions"
114114
fi
115115
eval "$xcodebuild_cmd" | xcbeautify $xcbeautify_args

0 commit comments

Comments
 (0)