|
| 1 | +name: iPhone Duo - iOS Native Check (Dimensions.getDisplayFeatures) |
| 2 | + |
| 3 | +# Standalone, manually-dispatched build that compiles the changed native file |
| 4 | +# (RCTDeviceInfo.mm) via the traditional CocoaPods RNTester integration — |
| 5 | +# self-contained, unlike the repo's normal iOS CI (test-ios-spm-rntester.yml / |
| 6 | +# e2e-ios-rntester.yml), which depend on prebuilt xcframework artifacts from |
| 7 | +# earlier jobs in test-all.yml and can't be dispatched on their own. |
| 8 | + |
| 9 | +on: |
| 10 | + workflow_dispatch: {} |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: macos-15-large |
| 15 | + timeout-minutes: 60 |
| 16 | + env: |
| 17 | + APP_IOS_DIR: packages/rn-tester |
| 18 | + XCODE_PROJECT: RNTesterPods.xcworkspace |
| 19 | + XCODE_SCHEME: RNTester |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v6 |
| 23 | + |
| 24 | + - name: Select Xcode (prefer 27.1, else latest installed) |
| 25 | + id: xcode |
| 26 | + run: | |
| 27 | + echo "Installed Xcode versions on this runner:" |
| 28 | + ls /Applications | grep -i '^Xcode' || true |
| 29 | + if [ -d "/Applications/Xcode_27.1.app" ]; then |
| 30 | + SELECTED="/Applications/Xcode_27.1.app" |
| 31 | + else |
| 32 | + SELECTED=$(ls -d /Applications/Xcode_*.app 2>/dev/null | sort -V | tail -1) |
| 33 | + fi |
| 34 | + if [ -z "$SELECTED" ]; then |
| 35 | + echo "::error::No Xcode installation found on this runner image." |
| 36 | + exit 1 |
| 37 | + fi |
| 38 | + sudo xcode-select --switch "$SELECTED" |
| 39 | + xcodebuild -version |
| 40 | + echo "selected=$SELECTED" >> "$GITHUB_OUTPUT" |
| 41 | + if [ "$SELECTED" != "/Applications/Xcode_27.1.app" ]; then |
| 42 | + echo "::warning::Xcode 27.1 is not on this GitHub-hosted runner image yet; fell back to $SELECTED. This run does NOT confirm compatibility with Xcode 27.1 specifically." |
| 43 | + fi |
| 44 | +
|
| 45 | + - name: Setup node.js |
| 46 | + uses: ./.github/actions/setup-node |
| 47 | + |
| 48 | + - name: Run yarn install |
| 49 | + uses: ./.github/actions/yarn-install |
| 50 | + |
| 51 | + - name: Set Hermes prebuilt version |
| 52 | + shell: bash |
| 53 | + run: node ./scripts/releases/use-hermes-prebuilt.js |
| 54 | + |
| 55 | + - name: Run yarn install again, with the correct hermes version |
| 56 | + uses: ./.github/actions/yarn-install |
| 57 | + |
| 58 | + - name: Install CocoaPods |
| 59 | + run: pod --version || sudo gem install cocoapods --no-document |
| 60 | + |
| 61 | + - name: pod install (traditional integration, builds React-Core/CoreModules from source) |
| 62 | + working-directory: ${{ env.APP_IOS_DIR }} |
| 63 | + run: pod install --repo-update |
| 64 | + |
| 65 | + - name: Build RNTester Debug for iOS Simulator (compiles RCTDeviceInfo.mm) |
| 66 | + working-directory: ${{ env.APP_IOS_DIR }} |
| 67 | + run: | |
| 68 | + xcodebuild \ |
| 69 | + -workspace "$XCODE_PROJECT" \ |
| 70 | + -scheme "$XCODE_SCHEME" \ |
| 71 | + -configuration Debug \ |
| 72 | + -sdk iphonesimulator \ |
| 73 | + -destination 'generic/platform=iOS Simulator' \ |
| 74 | + build 2>&1 | tee /tmp/xcodebuild.log |
| 75 | + if grep -qE "^\*\* BUILD FAILED \*\*|error:" /tmp/xcodebuild.log; then |
| 76 | + echo "::error::xcodebuild failed — see log above, especially any errors in RCTDeviceInfo.mm." |
| 77 | + exit 1 |
| 78 | + fi |
| 79 | + echo "RNTester (Debug, iphonesimulator) built cleanly, including the modified RCTDeviceInfo.mm." |
| 80 | +
|
| 81 | + - name: Upload build log |
| 82 | + if: always() |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: iphone-duo-rn-xcodebuild-log |
| 86 | + path: /tmp/xcodebuild.log |
0 commit comments