diff --git a/.github/workflows/microsoft-build-rntester-prebuilt.yml b/.github/workflows/microsoft-build-rntester-prebuilt.yml new file mode 100644 index 000000000000..cde84544f1de --- /dev/null +++ b/.github/workflows/microsoft-build-rntester-prebuilt.yml @@ -0,0 +1,71 @@ +name: Build RNTester (Prebuilt) + +on: + workflow_call: + +jobs: + build-rntester-prebuilt: + name: "Prebuilt ${{ matrix.platform }}, ${{ matrix.arch }}" + runs-on: macos-26 + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + platform: [macos, ios, visionos] + arch: [newarch] + include: + # Platform-specific properties + - platform: macos + sdk: macosx + scheme: RNTester-macOS + packager_platform: macos + - platform: ios + sdk: iphonesimulator + scheme: RNTester + packager_platform: ios + - platform: visionos + sdk: xrsimulator + scheme: RNTester-visionOS + packager_platform: ios + # Architecture-specific properties + - arch: newarch + new_arch_enabled: '1' + + steps: + - uses: actions/checkout@v4 + with: + filter: blob:none + fetch-depth: 0 + + - name: Setup toolchain + uses: ./.github/actions/microsoft-setup-toolchain + with: + node-version: '22' + platform: ${{ matrix.platform }} + project-root: 'packages/rn-tester' + + - name: Install npm dependencies + run: yarn install + + - name: Download prebuilt xcframework + uses: actions/download-artifact@v4 + with: + name: ReactCoreDebug.xcframework.tar.gz + path: /tmp/prebuilt + + - name: Install Pods (with prebuilt) + working-directory: packages/rn-tester + env: + RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }} + RCT_TESTONLY_RNCORE_TARBALL_PATH: /tmp/prebuilt/ReactCoreDebug.xcframework.tar.gz + run: | + set -eox pipefail + bundle install + bundle exec pod install --verbose + + - name: Build ${{ matrix.scheme }} + env: + USE_CCACHE: 0 + run: | + set -eox pipefail + .ado/scripts/xcodebuild.sh packages/rn-tester/RNTesterPods.xcworkspace ${{ matrix.sdk }} Debug ${{ matrix.scheme }} build diff --git a/.github/workflows/microsoft-build-rntester.yml b/.github/workflows/microsoft-build-rntester.yml index 20797e8f8d07..10ef532cc315 100644 --- a/.github/workflows/microsoft-build-rntester.yml +++ b/.github/workflows/microsoft-build-rntester.yml @@ -5,9 +5,11 @@ on: jobs: build-rntester: - name: "${{ matrix.platform }}, ${{ matrix.arch }}" + name: "${{ matrix.platform }}, ${{ matrix.arch }}${{ matrix.use_frameworks && ', DynamicFrameworks' || '' }}" runs-on: macos-26 timeout-minutes: 90 + # DynamicFrameworks is experimental; don't block PRs on it (matches upstream) + continue-on-error: ${{ matrix.use_frameworks == 'dynamic' }} strategy: fail-fast: false matrix: @@ -32,6 +34,14 @@ jobs: new_arch_enabled: '0' - arch: newarch new_arch_enabled: '1' + # DynamicFrameworks variant (matches upstream test_ios_rntester_dynamic_frameworks) + - platform: ios + arch: newarch + sdk: iphonesimulator + scheme: RNTester + packager_platform: ios + new_arch_enabled: '1' + use_frameworks: dynamic steps: - uses: actions/checkout@v4 @@ -55,6 +65,9 @@ jobs: RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }} run: | set -eox pipefail + if [[ -n "${{ matrix.use_frameworks }}" ]]; then + export USE_FRAMEWORKS="${{ matrix.use_frameworks }}" + fi bundle install bundle exec pod install --verbose diff --git a/.github/workflows/microsoft-pr.yml b/.github/workflows/microsoft-pr.yml index ee3a01e5dd01..94345c5ae6e6 100644 --- a/.github/workflows/microsoft-pr.yml +++ b/.github/workflows/microsoft-pr.yml @@ -112,24 +112,24 @@ jobs: with: filter: blob:none fetch-depth: 0 - + - name: Setup toolchain uses: ./.github/actions/microsoft-setup-toolchain with: node-version: '22' - + - name: Install npm dependencies run: yarn install - + - name: Run Jest tests run: yarn test-ci - + - name: Run Flow type checker run: yarn flow-check - + - name: Run ESLint run: yarn lint - + - name: Run Prettier format check run: yarn format-check @@ -143,6 +143,12 @@ jobs: permissions: {} uses: ./.github/workflows/microsoft-prebuild-macos-core.yml + build-rntester-prebuilt: + name: "Build RNTester (Prebuilt)" + permissions: {} + needs: [prebuild-macos-core] + uses: ./.github/workflows/microsoft-build-rntester-prebuilt.yml + test-react-native-macos-init: name: "Test react-native-macos init" permissions: {} @@ -170,6 +176,7 @@ jobs: - javascript-tests - build-rntester - prebuild-macos-core + - build-rntester-prebuilt - test-react-native-macos-init # - react-native-test-app-integration steps: diff --git a/packages/react-native/scripts/ios-prebuild/React-umbrella.h b/packages/react-native/scripts/ios-prebuild/React-umbrella.h index 45b365b92b9a..7567e809d9ee 100644 --- a/packages/react-native/scripts/ios-prebuild/React-umbrella.h +++ b/packages/react-native/scripts/ios-prebuild/React-umbrella.h @@ -6,7 +6,11 @@ */ #ifdef __OBJC__ +#if !TARGET_OS_OSX // [macOS] #import +#else // [macOS +#import +#endif // macOS] #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus)