From 74d6e93c2f649c83742cb2ffa398aebaeaab040d Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Wed, 12 Aug 2026 18:01:57 +0100 Subject: [PATCH] Make the iOS build scripts portable off GitHub Actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ``, 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. --- e2e/bitrise.yml | 6 ++++ .../react-native/sample/scripts/build_ios | 31 ++++++++++++------- .../react-native/sample/scripts/test_ios | 29 ++++++++++------- platforms/swift/Scripts/api | 7 ++++- platforms/swift/Scripts/xcode_run | 2 +- 5 files changed, 50 insertions(+), 25 deletions(-) diff --git a/e2e/bitrise.yml b/e2e/bitrise.yml index 046d1735d..93c45b974 100644 --- a/e2e/bitrise.yml +++ b/e2e/bitrise.yml @@ -42,6 +42,11 @@ trigger_map: pipelines: e2e: + # Bitrise's default report name is ci/bitrise//, + # which is identical for every pipeline on this app. A second triggered + # pipeline would then overwrite this one's commit status. + # expands to the pipeline id, so each pipeline owns its own check. + status_report_name: "ci/bitrise//" workflows: e2e-produce-browserstack-run-plan: {} e2e-build-react-native-ios: @@ -451,6 +456,7 @@ workflows: - script@1: title: Decide whether the nightly build runs timeout: 300 + no_output_timeout: 150 inputs: - content: |- set -euo pipefail diff --git a/platforms/react-native/sample/scripts/build_ios b/platforms/react-native/sample/scripts/build_ios index 898472bfb..6dcef74a8 100755 --- a/platforms/react-native/sample/scripts/build_ios +++ b/platforms/react-native/sample/scripts/build_ios @@ -25,18 +25,25 @@ dest="$(get_sim_destination)" cd ios xcbeautify_args="" -if [ "$CI" = "true" ]; then +if [ "${GITHUB_ACTIONS:-}" = "true" ]; then xcbeautify_args="--renderer github-actions" fi -xcodebuild clean build \ - -workspace CheckoutKitReactNativeDemo.xcworkspace \ - -scheme CheckoutKitReactNativeDemo \ - -sdk iphonesimulator \ - -destination "$dest" \ - -skipPackagePluginValidation \ - -disableAutomaticPackageResolution \ - GCC_PRECOMPILE_PREFIX_HEADER=YES \ - ASSETCATALOG_COMPILER_OPTIMIZATION=time \ - COMPILER_INDEX_STORE_ENABLE=NO \ -| xcbeautify $xcbeautify_args +run_xcodebuild() { + xcodebuild clean build \ + -workspace CheckoutKitReactNativeDemo.xcworkspace \ + -scheme CheckoutKitReactNativeDemo \ + -sdk iphonesimulator \ + -destination "$dest" \ + -skipPackagePluginValidation \ + -disableAutomaticPackageResolution \ + GCC_PRECOMPILE_PREFIX_HEADER=YES \ + ASSETCATALOG_COMPILER_OPTIMIZATION=time \ + COMPILER_INDEX_STORE_ENABLE=NO +} + +if command -v xcbeautify >/dev/null 2>&1; then + run_xcodebuild | xcbeautify $xcbeautify_args +else + run_xcodebuild +fi diff --git a/platforms/react-native/sample/scripts/test_ios b/platforms/react-native/sample/scripts/test_ios index f5bbb3906..a01e852af 100755 --- a/platforms/react-native/sample/scripts/test_ios +++ b/platforms/react-native/sample/scripts/test_ios @@ -35,17 +35,24 @@ else fi xcbeautify_args="" -if [ "$CI" = "true" ]; then +if [ "${GITHUB_ACTIONS:-}" = "true" ]; then xcbeautify_args="--renderer github-actions" fi -xcodebuild test \ - -workspace RCTIntegrationApp.xcworkspace \ - -scheme RCTIntegrationApp \ - -destination "$dest" \ - -skipPackagePluginValidation \ - -disableAutomaticPackageResolution \ - -sdk iphonesimulator \ - ASSETCATALOG_COMPILER_OPTIMIZATION=time \ - COMPILER_INDEX_STORE_ENABLE=NO \ -| xcbeautify $xcbeautify_args +run_xcodebuild() { + xcodebuild test \ + -workspace RCTIntegrationApp.xcworkspace \ + -scheme RCTIntegrationApp \ + -destination "$dest" \ + -skipPackagePluginValidation \ + -disableAutomaticPackageResolution \ + -sdk iphonesimulator \ + ASSETCATALOG_COMPILER_OPTIMIZATION=time \ + COMPILER_INDEX_STORE_ENABLE=NO +} + +if command -v xcbeautify >/dev/null 2>&1; then + run_xcodebuild | xcbeautify $xcbeautify_args +else + run_xcodebuild +fi diff --git a/platforms/swift/Scripts/api b/platforms/swift/Scripts/api index 58dcab750..561c49d29 100755 --- a/platforms/swift/Scripts/api +++ b/platforms/swift/Scripts/api @@ -41,9 +41,14 @@ build_for_digester() { SWIFT_TREAT_WARNINGS_AS_ERRORS=YES ) + local xcbeautify_args="" + if [ "${GITHUB_ACTIONS:-}" = "true" ]; then + xcbeautify_args="--renderer github-actions" + fi + cd "$PACKAGE_ROOT" if command -v xcbeautify >/dev/null 2>&1; then - "${cmd[@]}" | xcbeautify --renderer github-actions + "${cmd[@]}" | xcbeautify $xcbeautify_args else "${cmd[@]}" fi diff --git a/platforms/swift/Scripts/xcode_run b/platforms/swift/Scripts/xcode_run index e80845f26..3c7467c2d 100755 --- a/platforms/swift/Scripts/xcode_run +++ b/platforms/swift/Scripts/xcode_run @@ -109,7 +109,7 @@ fi if command -v xcbeautify >/dev/null 2>&1; then xcbeautify_args="" - if [ "$CI" = "true" ]; then + if [ "${GITHUB_ACTIONS:-}" = "true" ]; then xcbeautify_args="--renderer github-actions" fi eval "$xcodebuild_cmd" | xcbeautify $xcbeautify_args