11name : test-ios-rntester
22description : Test iOS RNTester
33inputs :
4- ruby-version :
5- description : The version of ruby that must be used
6- default : 2.6.10
74 run-unit-tests :
85 description : whether unit tests should run or not.
96 default : false
@@ -14,19 +11,9 @@ inputs:
1411 description : Whether we want to run E2E tests or not
1512 required : false
1613 default : false
17- use-frameworks :
18- description : Whether we have to build with Dynamic Frameworks.
19- required : false
20- default : false
21- use-prebuilds :
22- description : >-
23- Whether to consume the prebuilt ReactCore/ReactNativeDependencies
24- artifacts. 'auto' (default) keeps the historical coupling: prebuilds for
25- static, source for dynamic frameworks. Pass 'true' with
26- use-frameworks:true for the prebuilt + dynamic-frameworks lane (the
27- config of the 2026-07-03 SocketRocket dual-copy regression).
28- required : false
29- default : auto
14+ dependency-manager :
15+ description : ' How the app gets its native dependencies: swiftpm or cocoapods'
16+ default : swiftpm
3017
3118runs :
3219 using : composite
@@ -37,12 +24,23 @@ runs:
3724 uses : ./.github/actions/setup-node
3825 - name : Run yarn
3926 uses : ./.github/actions/yarn-install
27+ - name : Set Hermes prebuilt version
28+ shell : bash
29+ run : |
30+ node ./scripts/releases/use-hermes-prebuilt.js
31+ - name : Run yarn install again, with the correct hermes version
32+ uses : ./.github/actions/yarn-install
33+ - name : Prepare IOS Tests
34+ if : ${{ inputs.run-unit-tests == 'true' }}
35+ uses : ./.github/actions/prepare-ios-tests
4036 - name : Setup ruby
37+ if : ${{ inputs.dependency-manager == 'cocoapods' }}
4138 uses : ruby/setup-ruby@v1
4239 with :
43- ruby-version : ${{ inputs.ruby-version }}
40+ ruby-version : 2.6.10
4441 bundler : none
4542 - name : Install Bundler
43+ if : ${{ inputs.dependency-manager == 'cocoapods' }}
4644 shell : bash
4745 run : |
4846 BUNDLER_VERSION="$(awk '/BUNDLED WITH/{getline; print $1}' Gemfile.lock)"
@@ -62,86 +60,100 @@ runs:
6260 done
6361 echo "All 3 attempts failed."
6462 exit 1
65- - name : Set Hermes prebuilt version
66- shell : bash
67- run : |
68- node ./scripts/releases/use-hermes-prebuilt.js
69- - name : Run yarn install again, with the correct hermes version
70- uses : ./.github/actions/yarn-install
71- - name : Prepare IOS Tests
72- if : ${{ inputs.run-unit-tests == 'true' }}
73- uses : ./.github/actions/prepare-ios-tests
74- - name : Resolve prebuilds mode
75- id : prebuilds
76- shell : bash
77- run : |
78- if [[ "${{ inputs.use-prebuilds }}" == "auto" ]]; then
79- # Historical coupling: prebuilds for static, source for dynamic frameworks.
80- if [[ "${{ inputs.use-frameworks }}" == "true" ]]; then
81- echo "enabled=false" >> "$GITHUB_OUTPUT"
82- else
83- echo "enabled=true" >> "$GITHUB_OUTPUT"
84- fi
85- elif [[ "${{ inputs.use-prebuilds }}" == "true" ]]; then
86- echo "enabled=true" >> "$GITHUB_OUTPUT"
87- elif [[ "${{ inputs.use-prebuilds }}" == "false" ]]; then
88- echo "enabled=false" >> "$GITHUB_OUTPUT"
89- else
90- # Don't silently treat a typo as 'disabled' — surface it.
91- echo "::warning::Unexpected use-prebuilds value '${{ inputs.use-prebuilds }}' (expected auto/true/false); treating as disabled."
92- echo "enabled=false" >> "$GITHUB_OUTPUT"
93- fi
9463 - name : Download ReactNativeDependencies
95- if : ${{ steps.prebuilds.outputs.enabled == 'true ' }}
64+ if : ${{ inputs.dependency-manager == 'cocoapods ' }}
9665 uses : ./.github/actions/download-artifact
9766 with :
9867 name : ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz
9968 path : /tmp/third-party/
100- - name : Print third-party folder
101- if : ${{ steps.prebuilds.outputs.enabled == 'true' }}
102- shell : bash
103- run : ls -lR /tmp/third-party
10469 - name : Download React Native Prebuilds
105- if : ${{ steps.prebuilds.outputs.enabled == 'true ' }}
70+ if : ${{ inputs.dependency-manager == 'cocoapods ' }}
10671 uses : ./.github/actions/download-artifact
10772 with :
10873 name : ReactCore${{ inputs.flavor }}.xcframework.tar.gz
10974 path : /tmp/ReactCore
110- - name : Print ReactCore folder
111- if : ${{ steps.prebuilds.outputs.enabled == 'true' }}
112- shell : bash
113- run : ls -lR /tmp/ReactCore
11475 - name : Install CocoaPods dependencies
76+ if : ${{ inputs.dependency-manager == 'cocoapods' }}
11577 shell : bash
11678 run : |
117- if [[ ${{ inputs.use-frameworks }} == "true" ]]; then
118- export USE_FRAMEWORKS=dynamic
119- fi
120- if [[ "${{ steps.prebuilds.outputs.enabled }}" == "true" ]]; then
121- export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
122- export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
123- fi
79+ export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
80+ export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
12481
12582 cd packages/rn-tester
12683
12784 bundle install
12885 bundle exec pod update hermes-engine --no-repo-update
86+ - name : Download the XCFrameworks built in this run
87+ if : ${{ inputs.dependency-manager == 'swiftpm' }}
88+ uses : ./.github/actions/setup-spm-artifacts
89+ with :
90+ working-directory : packages/rn-tester
91+ # RNTester is a CocoaPods project in git, so developers can build React
92+ # Native from source. CI converts it to SwiftPM on every run.
93+ # react-native-test-library ships only a podspec; scaffold writes its
94+ # Package.swift.
95+ - name : Scaffold Package.swift manifests for community dependencies
96+ if : ${{ inputs.dependency-manager == 'swiftpm' }}
97+ shell : bash
98+ working-directory : packages/rn-tester
99+ run : npx react-native spm scaffold --artifacts /tmp/spm-artifacts --download skip || true
100+ - name : Convert RNTester to SwiftPM
101+ if : ${{ inputs.dependency-manager == 'swiftpm' }}
102+ shell : bash
103+ working-directory : packages/rn-tester
104+ run : RN_STRICT_API=1 npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip
105+ - name : Assert RNTester is on SwiftPM
106+ if : ${{ inputs.dependency-manager == 'swiftpm' }}
107+ shell : bash
108+ working-directory : packages/rn-tester
109+ run : |
110+ if [[ ! -f RNTesterPods.xcodeproj/.spm-injected.json ]]; then
111+ echo "::error::spm add did not inject SwiftPM: RNTesterPods.xcodeproj/.spm-injected.json is missing"
112+ exit 1
113+ fi
114+ if grep -q 'Pods-' RNTesterPods.xcodeproj/project.pbxproj; then
115+ echo "::error::spm add --deintegrate left CocoaPods references in RNTesterPods.xcodeproj"
116+ exit 1
117+ fi
118+ echo "SwiftPM injected in place; CocoaPods de-integrated."
129119 - name : Build RNTester
130120 shell : bash
131121 run : |
122+ if [[ "${{ inputs.dependency-manager }}" == "cocoapods" ]]; then
123+ container=(-workspace packages/rn-tester/RNTesterPods.xcworkspace)
124+ else
125+ container=(-project packages/rn-tester/RNTesterPods.xcodeproj)
126+ fi
132127 xcodebuild \
133128 -scheme "RNTester" \
134- -workspace packages/rn-tester/RNTesterPods.xcworkspace \
129+ "${container[@]}" \
135130 -configuration "${{ inputs.flavor }}" \
136131 -sdk "iphonesimulator" \
137132 -destination "generic/platform=iOS Simulator" \
138133 -derivedDataPath "/tmp/RNTesterBuild"
139134
140- echo "Print path to *.app file"
141- APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app")
142-
143- echo "App found at $APP_PATH"
144- echo "app-path=$APP_PATH" >> $GITHUB_ENV
135+ APP_PATH="/tmp/RNTesterBuild/Build/Products/${{ inputs.flavor }}-iphonesimulator/RNTester.app"
136+ echo "App found at $APP_PATH"
137+ echo "app-path=$APP_PATH" >> $GITHUB_ENV
138+ - name : Check the embedded React.framework flavor
139+ if : ${{ inputs.dependency-manager == 'swiftpm' }}
140+ shell : bash
141+ run : |
142+ BINARY="${{ env.app-path }}/Frameworks/React.framework/React"
143+ if [[ ! -f "$BINARY" ]]; then
144+ echo "::error::No embedded React.framework binary at $BINARY"
145+ exit 1
146+ fi
147+ COUNT=$(nm "$BINARY" | grep -c getDebugProps || true)
148+ echo "getDebugProps symbols in $BINARY: $COUNT"
149+ if [[ "${{ inputs.flavor }}" == 'Debug' && "$COUNT" -eq 0 ]]; then
150+ echo "::error::Debug build embeds a Release React.framework (expected getDebugProps symbols, found none)"
151+ exit 1
152+ fi
153+ if [[ "${{ inputs.flavor }}" == 'Release' && "$COUNT" -ne 0 ]]; then
154+ echo "::error::Release build embeds a Debug React.framework ($COUNT getDebugProps symbols, expected none)"
155+ exit 1
156+ fi
145157 - name : ' Run Tests: iOS Unit and Integration Tests'
146158 if : ${{ inputs.run-unit-tests == 'true' }}
147159 shell : bash
@@ -156,19 +168,19 @@ runs:
156168 tar -zcvf xcresults.tar.gz "/tmp/RNTesterTestResults"
157169 - name : Upload artifact
158170 uses : ./.github/actions/upload-artifact
159- if : ${{ inputs.run-unit-tests == 'true' }}
171+ if : ${{ inputs.run-unit-tests == 'true' && inputs.dependency-manager == 'swiftpm' }}
160172 with :
161- name : xcresults-${{ inputs.flavor }}-${{ inputs.use-frameworks == 'true' && 'dynamic-frameworks' || 'static-libraries' }}-Ruby${{ inputs.ruby-version }}
173+ name : xcresults-${{ inputs.flavor }}
162174 path : /Users/runner/Library/Developer/Xcode/xcresults.tar.gz
163175 - name : Upload RNTester App
164- if : ${{ inputs.use-frameworks == 'false' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
176+ if : ${{ inputs.dependency-manager == 'swiftpm' }} # The e2e tests download this artifact; one upload per name
165177 uses : ./.github/actions/upload-artifact
166178 with :
167179 name : RNTesterApp-NewArch-${{ inputs.flavor }}
168180 path : ${{ env.app-path }}
169181 - name : Store test results
170- if : ${{ inputs.run-unit-tests == 'true' }}
182+ if : ${{ inputs.run-unit-tests == 'true' && inputs.dependency-manager == 'swiftpm' }}
171183 uses : ./.github/actions/upload-artifact
172184 with :
173- name : test-results-${{ inputs.flavor }}-${{ inputs.use-frameworks == 'true' && 'dynamic-frameworks' || 'static-libraries' }}-Ruby${{ inputs.ruby-version }}
185+ name : test-results-${{ inputs.flavor }}
174186 path : ./reports/junit
0 commit comments