diff --git a/.github/actions/test_ios_template/action.yml b/.github/actions/test_ios_helloworld/action.yml similarity index 62% rename from .github/actions/test_ios_template/action.yml rename to .github/actions/test_ios_helloworld/action.yml index f8f66d40cc9f6c..0cdc9cf017cd5b 100644 --- a/.github/actions/test_ios_template/action.yml +++ b/.github/actions/test_ios_helloworld/action.yml @@ -1,21 +1,37 @@ -name: test_ios_template -description: Test iOS Template +name: test_ios_helloworld +description: Test iOS Hello World inputs: jsengine: description: Which JavaScript engine to use. Must be one of "Hermes", "JSC". + type: choice default: Hermes + options: + - JSC + - Hermes use-frameworks: description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks" + type: choice default: StaticLibraries + options: + - StaticLibraries + - DynamicFrameworks architecture: description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup + type: choice default: OldArch + options: + - OldArch + - NewArch ruby-version: description: The version of ruby that must be used default: 2.6.10 flavor: description: The flavor of the build. Must be one of "Debug", "Release". + type: choice default: Debug + options: + - Debug + - Release hermes-version: description: The version of hermes required: true @@ -38,11 +54,6 @@ runs: with: hermes-version: ${{ inputs.hermes-version }} react-native-version: ${{ inputs.react-native-version }} - - name: Download npm package artifact - uses: actions/download-artifact@v4.1.3 - with: - name: react-native-package - path: build - name: Setup Hermes workspace uses: ./.github/actions/setup_hermes_workspace - name: Setup ruby @@ -56,43 +67,30 @@ runs: BUILD_TYPE="${{ inputs.flavor }}" TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE") echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $GITHUB_ENV - - name: Create iOS template project - shell: bash - run: | - PACKAGE=$(cat build/react-native-package-version) - PATH_TO_PACKAGE="$GITHUB_WORKSPACE/build/$PACKAGE" - node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$PATH_TO_PACKAGE\"}" - node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$GITHUB_WORKSPACE/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose - - name: Yarn install in template project - shell: bash - run: | - cd /tmp/$PROJECT_NAME/android/ - yarn install --non-interactive - name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }} shell: bash run: | - cd /tmp/$PROJECT_NAME/ios + cd packages/helloworld + args=() - if [[ ${{ inputs.architecture }} == "NewArch" ]]; then - export RCT_NEW_ARCH_ENABLED=1 + if [[ ${{ inputs.architecture }} == "OldArch" ]]; then + args+=(--arch old) fi if [[ ${{ inputs.jsengine }} == "JSC" ]]; then - export USE_HERMES=0 + args+=(--jsvm jsc) fi - if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then - export USE_FRAMEWORKS=dynamic + args+=(--frameworks dynamic) fi - - cd .. - bundle install - bundle exec pod install --project-directory=ios - - name: Build template project + yarn bootstrap ios "${args[@]}" | cat + - name: Build HelloWorld project shell: bash run: | - xcodebuild build \ - -configuration ${{ inputs.flavor }} \ - -workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \ - -scheme $PROJECT_NAME \ - -sdk iphonesimulator + cd packages/helloworld + args=() + if [[ ${{ inputs.flavor }} == "Release" ]]; then + args+=(--prod) + fi + yarn build ios "${args[@]}" | cat + yarn bundle ios "${args[@]}" | cat diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 06d3b4b588a1ba..b3bae9e5fb1930 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,6 +21,7 @@ jobs: run: | echo "Setting release type to nightly" echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT + prepare_hermes_workspace: runs-on: ubuntu-latest env: @@ -75,8 +76,9 @@ jobs: cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/. echo ${{ steps.hermes-version.outputs.version }} + build_hermesc_apple: - runs-on: macos-13 + runs-on: macos-13-large needs: prepare_hermes_workspace env: HERMES_WS_DIR: /tmp/hermes @@ -104,8 +106,9 @@ jobs: cd ./packages/react-native/sdks/hermes || exit 1 . ./utils/build-apple-framework.sh build_host_hermesc_if_needed + build_apple_slices_hermes: - runs-on: macos-14 + runs-on: macos-14-large needs: [build_hermesc_apple, prepare_hermes_workspace] env: HERMES_WS_DIR: /tmp/hermes @@ -133,14 +136,14 @@ jobs: - name: Check if the required artifacts already exist id: check_if_apple_artifacts_are_there run: | - if ${{ matrix.flavor == 'Debug' }} && \\ + if ${{ matrix.flavor == 'Debug' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-debug == true }} ; then echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV fi - if ${{ matrix.flavor == 'Release' }} && \\ + if ${{ matrix.flavor == 'Release' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-release == true }} ; then @@ -192,8 +195,9 @@ jobs: with: path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }} key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }} + build_hermes_macos: - runs-on: macos-13 + runs-on: macos-13-large needs: [build_apple_slices_hermes, prepare_hermes_workspace] env: HERMES_WS_DIR: /tmp/hermes @@ -221,14 +225,14 @@ jobs: - name: Check if the required artifacts already exist id: check_if_apple_artifacts_are_there run: | - if ${{ matrix.flavor == 'Debug' }} && + if ${{ matrix.flavor == 'Debug' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-debug == true }} ; then echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV fi - if ${{ matrix.flavor == 'Release' }} && \\ + if ${{ matrix.flavor == 'Release' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-release == true }} ; then @@ -365,6 +369,7 @@ jobs: with: name: hermes-dSYM-${{ matrix.flavor }} path: /tmp/hermes/dSYM/${{ matrix.flavor }} + build_hermesc_linux: runs-on: ubuntu-latest needs: prepare_hermes_workspace @@ -409,6 +414,7 @@ jobs: with: name: hermes-linux-bin path: /tmp/hermes/linux64-bin + build_hermesc_windows: runs-on: windows-2019 needs: prepare_hermes_workspace @@ -489,6 +495,7 @@ jobs: with: name: hermes-win64-bin path: D:\tmp\hermes\win64-bin\ + build_android: runs-on: 8-core-ubuntu needs: [set_release_type] diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 05b8fa743e8f33..91e19c1ca1e9bf 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -3,7 +3,7 @@ name: Publish release on: push: tags: - - "v0\.[0-9]+\.[0-9]+(-\S+)?" # This should match v0.X.Y, v0.X.Y-rc.0 + - "v0\.[0-9]+\.[0-9]+([-]\S+)?" # This should match v0.X.Y, v0.X.Y-rc.0 jobs: set_release_type: @@ -19,6 +19,7 @@ jobs: run: | echo "Setting release type to release" echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT + prepare_hermes_workspace: runs-on: ubuntu-latest env: @@ -73,8 +74,9 @@ jobs: cp -r packages/react-native/sdks/hermes/* $HERMES_WS_DIR/hermes/. echo ${{ steps.hermes-version.outputs.version }} + build_hermesc_apple: - runs-on: macos-13 + runs-on: macos-14-large needs: prepare_hermes_workspace env: HERMES_WS_DIR: /tmp/hermes @@ -102,8 +104,9 @@ jobs: cd ./packages/react-native/sdks/hermes || exit 1 . ./utils/build-apple-framework.sh build_host_hermesc_if_needed + build_apple_slices_hermes: - runs-on: macos-14 + runs-on: macos-14-large needs: [build_hermesc_apple, prepare_hermes_workspace] env: HERMES_WS_DIR: /tmp/hermes @@ -131,14 +134,14 @@ jobs: - name: Check if the required artifacts already exist id: check_if_apple_artifacts_are_there run: | - if ${{ matrix.flavor == 'Debug' }} && \\ + if ${{ matrix.flavor == 'Debug' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-debug == true }} ; then echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV fi - if ${{ matrix.flavor == 'Release' }} && \\ + if ${{ matrix.flavor == 'Release' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-release == true }} ; then @@ -190,8 +193,9 @@ jobs: with: path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }} key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }} + build_hermes_macos: - runs-on: macos-13 + runs-on: macos-14-large needs: [build_apple_slices_hermes, prepare_hermes_workspace] env: HERMES_WS_DIR: /tmp/hermes @@ -363,6 +367,7 @@ jobs: with: name: hermes-dSYM-${{ matrix.flavor }} path: /tmp/hermes/dSYM/${{ matrix.flavor }} + build_hermesc_linux: runs-on: ubuntu-latest needs: prepare_hermes_workspace @@ -407,6 +412,7 @@ jobs: with: name: hermes-linux-bin path: /tmp/hermes/linux64-bin + build_hermesc_windows: runs-on: windows-2019 needs: prepare_hermes_workspace @@ -487,6 +493,7 @@ jobs: with: name: hermes-win64-bin path: D:\tmp\hermes\win64-bin\ + build_android: runs-on: 8-core-ubuntu needs: [set_release_type] diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 681e8141fe826d..7b34d3b60020e6 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -83,7 +83,7 @@ jobs: echo ${{ steps.hermes-version.outputs.version }} build_hermesc_apple: - runs-on: macos-13 + runs-on: macos-13-large needs: prepare_hermes_workspace env: HERMES_WS_DIR: /tmp/hermes @@ -140,14 +140,14 @@ jobs: - name: Check if the required artifacts already exist id: check_if_apple_artifacts_are_there run: | - if ${{ matrix.flavor == 'Debug' }} && \\ + if ${{ matrix.flavor == 'Debug' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-debug == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-debug == true }} ; then echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV fi - if ${{ matrix.flavor == 'Release' }} && \\ + if ${{ matrix.flavor == 'Release' }} && \ ${{ steps.cache_setup.outputs.cache-hit-hermes-tarball-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-macos-bin-release == true }} && \ ${{ steps.cache_setup.outputs.cache-hit-dsym-release == true }} ; then @@ -200,7 +200,7 @@ jobs: path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }} key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }} build_hermes_macos: - runs-on: macos-13 + runs-on: macos-13-large needs: [build_apple_slices_hermes, prepare_hermes_workspace] env: HERMES_WS_DIR: /tmp/hermes @@ -373,7 +373,7 @@ jobs: name: hermes-dSYM-${{ matrix.flavor }} path: /tmp/hermes/dSYM/${{ matrix.flavor }} test_ios_rntester_ruby_3_2_0: - runs-on: macos-13 + runs-on: macos-14 needs: [build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] env: @@ -389,7 +389,7 @@ jobs: hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} test_ios_rntester_dynamic_frameworks: - runs-on: macos-13 + runs-on: macos-14 needs: [build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] env: @@ -411,7 +411,7 @@ jobs: hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} test_ios_rntester: - runs-on: macos-13 + runs-on: macos-14 needs: [build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] env: @@ -851,9 +851,9 @@ jobs: name: template-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }} path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/ compression-level: 0 - test_ios_template_with_ruby_3_2_0: - runs-on: macos-13 - needs: [prepare_hermes_workspace, build_npm_package] + test_ios_helloworld_with_ruby_3_2_0: + runs-on: macos-14 + needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs env: PROJECT_NAME: iOSTemplateProject HERMES_WS_DIR: /tmp/hermes @@ -861,16 +861,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 - - uses: ./.github/actions/test_ios_template + - uses: ./.github/actions/test_ios_helloworld with: ruby-version: 3.2.0 architecture: NewArch flavor: Debug hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} - test_ios_template: - runs-on: macos-13 - needs: [prepare_hermes_workspace, build_npm_package] + test_ios_helloworld: + runs-on: macos-14 + needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs strategy: matrix: flavor: [Debug, Release] @@ -888,7 +888,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 - - uses: ./.github/actions/test_ios_template + - uses: ./.github/actions/test_ios_helloworld with: flavor: ${{ matrix.flavor }} jsengine: ${{ matrix.jsengine }}