Skip to content

Commit 33f83c3

Browse files
committed
Merge branch 'main' into bugfix/ios-pointer-hover-mounting
2 parents 7034c7a + f480836 commit 33f83c3

318 files changed

Lines changed: 3396 additions & 1523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: setup-spm-artifacts
2+
description: >-
3+
Downloads the ReactCore and ReactNativeDependencies XCFrameworks built in this
4+
run, in both flavors, into the SwiftPM artifact root /tmp/spm-artifacts. Pass
5+
`--artifacts /tmp/spm-artifacts --download skip` to the `react-native spm`
6+
command that follows.
7+
inputs:
8+
working-directory:
9+
description: The app directory that `npx react-native spm download` runs from.
10+
required: true
11+
runs:
12+
using: composite
13+
steps:
14+
# Both flavors are needed by every build, not just the one it builds:
15+
# `spm` stages both flavor framework trees and lets a per-configuration
16+
# build setting pick one at build time, so it validates the debug/ and
17+
# release/ artifact slots together (and `--download skip` refuses an
18+
# incomplete slot). Please don't "optimise" this down to one flavor.
19+
- name: Download ReactCore (Debug)
20+
uses: ./.github/actions/download-artifact
21+
with:
22+
name: ReactCoreDebug.xcframework.tar.gz
23+
path: /tmp/rc-debug
24+
- name: Download ReactCore (Release)
25+
uses: ./.github/actions/download-artifact
26+
with:
27+
name: ReactCoreRelease.xcframework.tar.gz
28+
path: /tmp/rc-release
29+
- name: Download ReactNativeDependencies (Debug)
30+
uses: ./.github/actions/download-artifact
31+
with:
32+
name: ReactNativeDependenciesDebug.xcframework.tar.gz
33+
path: /tmp/deps-debug
34+
- name: Download ReactNativeDependencies (Release)
35+
uses: ./.github/actions/download-artifact
36+
with:
37+
name: ReactNativeDependenciesRelease.xcframework.tar.gz
38+
path: /tmp/deps-release
39+
# The ordinary `spm download`, pointed at the XCFrameworks this run just
40+
# built rather than at the published nightly (RN_CORE_TARBALL_PATH /
41+
# RN_DEPS_TARBALL_PATH are overrides download-spm-artifacts.js already
42+
# supports). It fills both flavor slots per call and skips any slot that
43+
# already validates, so it runs twice: the first pass fills both slots
44+
# from the Release tarballs, then debug/ is dropped and refilled from the
45+
# Debug tarballs while release/ is left alone. hermes-engine is fetched
46+
# from Maven by the command itself.
47+
- name: Stage the XCFrameworks for SwiftPM (Debug + Release)
48+
shell: bash
49+
working-directory: ${{ inputs.working-directory }}
50+
run: |
51+
RN_CORE_TARBALL_PATH=/tmp/rc-release/ReactCoreRelease.xcframework.tar.gz \
52+
RN_DEPS_TARBALL_PATH=/tmp/deps-release/ReactNativeDependenciesRelease.xcframework.tar.gz \
53+
npx react-native spm download --artifacts /tmp/spm-artifacts
54+
rm -rf /tmp/spm-artifacts/debug
55+
RN_CORE_TARBALL_PATH=/tmp/rc-debug/ReactCoreDebug.xcframework.tar.gz \
56+
RN_DEPS_TARBALL_PATH=/tmp/deps-debug/ReactNativeDependenciesDebug.xcframework.tar.gz \
57+
npx react-native spm download --artifacts /tmp/spm-artifacts

‎.github/actions/test-ios-helloworld/action.yml‎

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
name: test-ios-helloworld
22
description: Test iOS Hello World
33
inputs:
4-
use-frameworks:
5-
description: Whether to build with dynamic frameworks.
6-
default: false
7-
ruby-version:
8-
description: The version of ruby that must be used
9-
default: 2.6.10
104
flavor:
115
description: The flavor of the build. Must be one of "Debug", "Release".
126
default: Debug
7+
dependency-manager:
8+
description: 'How the app gets its native dependencies: swiftpm or cocoapods'
9+
default: swiftpm
1310
runs:
1411
using: composite
1512
steps:
@@ -19,46 +16,64 @@ runs:
1916
uses: ./.github/actions/setup-node
2017
- name: Run yarn install
2118
uses: ./.github/actions/yarn-install
22-
- name: Setup ruby
23-
uses: ruby/setup-ruby@v1
24-
with:
25-
ruby-version: ${{ inputs.ruby-version }}
2619
- name: Set Hermes prebuilt version
2720
shell: bash
2821
run: |
2922
node ./scripts/releases/use-hermes-prebuilt.js
3023
- name: Run yarn install again, with the correct hermes version
3124
uses: ./.github/actions/yarn-install
25+
- name: Setup ruby
26+
if: ${{ inputs.dependency-manager == 'cocoapods' }}
27+
uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: 2.6.10
3230
- name: Download ReactNativeDependencies
31+
if: ${{ inputs.dependency-manager == 'cocoapods' }}
3332
uses: ./.github/actions/download-artifact
3433
with:
3534
name: ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz
3635
path: /tmp/third-party
37-
- name: Print third-party folder
38-
shell: bash
39-
run: ls -lR /tmp/third-party
4036
- name: Download React Native Prebuilds
37+
if: ${{ inputs.dependency-manager == 'cocoapods' }}
4138
uses: ./.github/actions/download-artifact
4239
with:
4340
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
4441
path: /tmp/ReactCore
45-
- name: Print ReactCore folder
46-
shell: bash
47-
run: ls -lR /tmp/ReactCore
48-
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }};
42+
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}
43+
if: ${{ inputs.dependency-manager == 'cocoapods' }}
4944
shell: bash
5045
run: |
5146
cd private/helloworld
52-
args=()
53-
54-
if [[ "${{ inputs.use-frameworks }}" == "true" ]]; then
55-
args+=(--frameworks dynamic)
56-
fi
5747
5848
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
5949
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
6050
61-
yarn bootstrap ios "${args[@]}" | cat
51+
yarn bootstrap ios | cat
52+
- name: Download the XCFrameworks built in this run
53+
if: ${{ inputs.dependency-manager == 'swiftpm' }}
54+
uses: ./.github/actions/setup-spm-artifacts
55+
with:
56+
working-directory: private/helloworld/ios
57+
# HelloWorld is a CocoaPods project in git. CI converts it to SwiftPM on every run.
58+
- name: Convert HelloWorld to SwiftPM
59+
if: ${{ inputs.dependency-manager == 'swiftpm' }}
60+
shell: bash
61+
working-directory: private/helloworld/ios
62+
run: RN_STRICT_API=1 npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip
63+
- name: Assert HelloWorld is on SwiftPM
64+
if: ${{ inputs.dependency-manager == 'swiftpm' }}
65+
shell: bash
66+
working-directory: private/helloworld/ios
67+
run: |
68+
if [[ ! -f HelloWorld.xcodeproj/.spm-injected.json ]]; then
69+
echo "::error::spm add did not inject SwiftPM: HelloWorld.xcodeproj/.spm-injected.json is missing"
70+
exit 1
71+
fi
72+
if grep -q 'Pods-' HelloWorld.xcodeproj/project.pbxproj; then
73+
echo "::error::spm add --deintegrate left CocoaPods references in HelloWorld.xcodeproj"
74+
exit 1
75+
fi
76+
echo "SwiftPM injected in place; CocoaPods de-integrated."
6277
6378
- name: Run Helloworld tests
6479
shell: bash
Lines changed: 86 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: test-ios-rntester
22
description: Test iOS RNTester
33
inputs:
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

3118
runs:
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

Comments
 (0)