diff --git a/.github/actions/prepare_ios_tests/action.yml b/.github/actions/prepare_ios_tests/action.yml new file mode 100644 index 0000000000..629ef73263 --- /dev/null +++ b/.github/actions/prepare_ios_tests/action.yml @@ -0,0 +1,25 @@ +name: prepare_ios_tests +description: Prepare iOS Tests +runs: + using: composite + steps: + - name: brew install xcbeautify + run: brew install xcbeautify + shell: bash + - name: Run Ruby Tests + shell: bash + run: | + cd packages/react-native/scripts + sh run_ruby_tests.sh + - name: Boot iPhone Simulator + shell: bash + run: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true + - name: "Brew: Tap wix/brew" + shell: bash + run: brew tap wix/brew + - name: brew install applesimutils watchman + shell: bash + run: brew install applesimutils watchman + - name: Configure Watchman + shell: bash + run: echo "{}" > .watchmanconfig diff --git a/.github/actions/report_bundle_size/action.yml b/.github/actions/report_bundle_size/action.yml new file mode 100644 index 0000000000..22ca863f54 --- /dev/null +++ b/.github/actions/report_bundle_size/action.yml @@ -0,0 +1,12 @@ +name: report_bundle_size +description: Report bundle size +inputs: + platform: + description: Platform. Either ios or android + default: ios +runs: + using: composite + steps: + - name: Report size of RNTester.app (analysis-bot) + shell: bash + run: GITHUB_TOKEN=${{ secrets.PUBLIC_ANALYSISBOT_GITHUB_TOKEN }} scripts/circleci/report-bundle-size.sh ${{ inputs.platform }} || true diff --git a/.github/actions/run_e2e/action.yml b/.github/actions/run_e2e/action.yml new file mode 100644 index 0000000000..5e479ce668 --- /dev/null +++ b/.github/actions/run_e2e/action.yml @@ -0,0 +1,17 @@ +name: run_e2e +description: "Run End-to-End Tests" +inputs: + platform: + description: "Platform to run tests on" + required: true + default: "js" + retries: + description: "Number of times to retry failed tests" + required: true + default: "3" +runs: + using: composite + steps: + - name: "Run Tests: ${{ inputs.platform }} End-to-End Tests" + run: node ./scripts/e2e/run-ci-e2e-tests.js --${{ inputs.platform }} --retries ${{ inputs.retries }} + shell: bash diff --git a/.github/actions/test_ios_template/action.yml b/.github/actions/test_ios_template/action.yml new file mode 100644 index 0000000000..f8f66d40cc --- /dev/null +++ b/.github/actions/test_ios_template/action.yml @@ -0,0 +1,98 @@ +name: test_ios_template +description: Test iOS Template +inputs: + jsengine: + description: Which JavaScript engine to use. Must be one of "Hermes", "JSC". + default: Hermes + use-frameworks: + description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks" + default: StaticLibraries + 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 + default: OldArch + 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". + default: Debug + hermes-version: + description: The version of hermes + required: true + react-native-version: + description: The version of react-native + required: true +runs: + using: composite + steps: + - name: Setup xcode + uses: ./.github/actions/setup-xcode + - name: Setup node.js + uses: ./.github/actions/setup-node + - name: Run yarn + shell: bash + run: yarn install --non-interactive + - name: Cache setup + id: cache_setup + uses: ./.github/actions/cache_setup + 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 + uses: ruby/setup-ruby@v1.170.0 + with: + ruby-version: ${{ inputs.ruby-version }} + - name: Set HERMES_ENGINE_TARBALL_PATH + if: inputs.jsengine == 'Hermes' + shell: bash + run: | + 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 + + if [[ ${{ inputs.architecture }} == "NewArch" ]]; then + export RCT_NEW_ARCH_ENABLED=1 + fi + + if [[ ${{ inputs.jsengine }} == "JSC" ]]; then + export USE_HERMES=0 + fi + + if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then + export USE_FRAMEWORKS=dynamic + fi + + cd .. + bundle install + bundle exec pod install --project-directory=ios + - name: Build template project + shell: bash + run: | + xcodebuild build \ + -configuration ${{ inputs.flavor }} \ + -workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \ + -scheme $PROJECT_NAME \ + -sdk iphonesimulator diff --git a/.github/workflows/ios-tests.yml b/.github/workflows/ios-tests.yml index a8ccb3cbf4..d2aae0c779 100644 --- a/.github/workflows/ios-tests.yml +++ b/.github/workflows/ios-tests.yml @@ -14,11 +14,10 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 + - name: Setup node.js + uses: ./.github/actions/setup-node with: node-version: 20 - cache: 'yarn' - name: Yarn Install run: yarn install - name: Get latest commit from Hermes diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 39dce4fcaf..dc96287e8b 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -414,6 +414,130 @@ jobs: use-frameworks: StaticLibraries hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + build_hermesc_linux: + runs-on: ubuntu-latest + needs: prepare_hermes_workspace + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y git openssh-client cmake build-essential \ + libreadline-dev libicu-dev jq zip python3 + - name: Cache setup + id: cache_setup + uses: ./.github/actions/cache_setup + with: + hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} + react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + - name: Linux cache + uses: actions/cache@v4.0.0 + with: + key: v1-hermes-${{ github.job }}-linux-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + path: | + /tmp/hermes/linux64-bin/ + /tmp/hermes/hermes/destroot/ + - name: Set up workspace + run: | + mkdir -p /tmp/hermes/linux64-bin + - name: Build HermesC for Linux + run: | + if [ -f /tmp/hermes/linux64-bin/hermesc ]; then + echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.' + else + cd /tmp/hermes + cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive" + cmake --build build --target hermesc -j 4 + cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/. + fi + - name: Upload linux artifacts + uses: actions/upload-artifact@v4.3.0 + with: + name: hermes-linux-bin + path: /tmp/hermes/linux64-bin + build_hermesc_windows: + runs-on: windows-2019 + needs: prepare_hermes_workspace + env: + HERMES_WS_DIR: 'D:\tmp\hermes' + ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip" + MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin' + CMAKE_DIR: 'C:\Program Files\CMake\bin' + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Cache setup + id: cache_setup + uses: ./.github/actions/cache_setup + with: + hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} + react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + - name: Windows cache + uses: actions/cache@v4.0.0 + with: + key: v2-hermes-${{ github.job }}-windows-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + path: | + D:\tmp\hermes\win64-bin\ + D:\tmp\hermes\hermes\icu\ + D:\tmp\hermes\hermes\deps\ + D:\tmp\hermes\hermes\build_release\ + - name: setup-msbuild + uses: microsoft/setup-msbuild@v1.3.2 + - name: Set up workspace + run: | + #New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR + New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu + New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps + New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin + #New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\hermes + #New-Item -ItemType SymbolicLink -ErrorAction SilentlyContinue -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes + - name: Build HermesC for Windows + run: | + if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) { + choco install --no-progress cmake --version 3.14.7 + if (-not $?) { throw "Failed to install CMake" } + + cd $Env:HERMES_WS_DIR\icu + # If Invoke-WebRequest shows a progress bar, it will fail with + # Win32 internal error "Access is denied" 0x5 occurred [...] + $progressPreference = 'silentlyContinue' + Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip" + Expand-Archive -Path "icu.zip" -DestinationPath "." + + cd $Env:HERMES_WS_DIR + Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps" + # Include MSVC++ 2015 redistributables + Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps" + Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps" + Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps" + + $Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR" + $Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu" + + cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF + if (-not $?) { throw "Failed to configure Hermes" } + echo "Running windows build..." + cd build_release + cmake --build . --target hermesc --config Release + if (-not $?) { throw "Failed to build Hermes" } + + echo "Copying hermesc.exe to win64-bin" + cd $Env:HERMES_WS_DIR + Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin" + # Include Windows runtime dependencies + Copy-Item -Path "deps\*" -Destination "win64-bin" + } + else { + Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild." + } + - name: Upload windows artifacts + uses: actions/upload-artifact@v4.3.0 + with: + name: hermes-win64-bin + path: D:\tmp\hermes\win64-bin\ build_android: runs-on: 8-core-ubuntu needs: [set_release_type, prepare_hermes_workspace] @@ -517,3 +641,277 @@ jobs: with: name: rntester-apk path: packages/rn-tester/android/app/build/outputs/apk/ + build_npm_package: + runs-on: 4-core-ubuntu-latest + needs: [set_release_type, prepare_hermes_workspace, build_hermes_macos, build_hermesc_linux, build_hermesc_windows,build_android] + container: + image: reactnativecommunity/react-native-android:latest + env: + TERM: "dumb" + GRADLE_OPTS: '-Dorg.gradle.daemon=false' + # By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs. + ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" + # Repeated here, as the environment key in this executor will overwrite the one in defaults + PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_A }} + PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: ${{ secrets.GITHUB_ANALYSISBOT_TOKEN_B }} + HERMES_WS_DIR: /tmp/hermes + steps: + - name: Add github.com to SSH known hosts + run: | + mkdir -p ~/.ssh + echo '|1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Create /tmp/hermes/osx-bin directory + run: mkdir -p /tmp/hermes/osx-bin + - name: Download osx-bin release artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-osx-bin-Release + path: /tmp/hermes/osx-bin + - name: Download osx-bin debug artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-osx-bin-Debug + path: /tmp/hermes/osx-bin + - name: Download darwin-bin release artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-darwin-bin-Release + path: /tmp/hermes/hermes-runtime-darwin + - name: Download darwin-bin debug artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-darwin-bin-Debug + path: /tmp/hermes/hermes-runtime-darwin + - name: Download hermes dSYM debug artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-dSYM-Debug + path: /tmp/hermes/dSYM/Debug + - name: Download hermes dSYM release vartifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-dSYM-Release + path: /tmp/hermes/dSYM/Release + - name: Download windows-bin artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-win64-bin + path: /tmp/hermes/win64-bin + - name: Download linux-bin artifacts + uses: actions/download-artifact@v4.1.3 + with: + name: hermes-linux-bin + path: /tmp/hermes/linux64-bin + - name: Show /tmp/hermes directory + run: ls -lR /tmp/hermes + - name: Cache setup + id: cache_setup + uses: ./.github/actions/cache_setup + with: + hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} + react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + - name: Copy Hermes binaries + shell: bash + run: | + mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin + + # When build_hermes_macos runs as a matrix, it outputs + if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then + cp -r $HERMES_WS_DIR/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/. + elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then + cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/. + else + ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing." + echo "Could not locate macOS hermesc binary."; exit 1; + fi + + cp -r $HERMES_WS_DIR/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/. + cp -r $HERMES_WS_DIR/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/. + mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/ + cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz + cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz + cp $HERMES_WS_DIR/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz + cp $HERMES_WS_DIR/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz + - name: Use Node.js 18 + uses: actions/setup-node@v4.0.0 + with: + node-version: 18 + cache: 'yarn' + - name: Install dependencies + run: yarn install --non-interactive + - name: Build packages + run: yarn build + # Continue with publish steps + - name: Set npm credentials + if: needs.set_release_type.outputs.RELEASE_TYPE == 'release' || + needs.set_release_type.outputs.RELEASE_TYPE == 'nightly' + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.CIRCLE_NPM_TOKEN }}" > ~/.npmrc + - name: Publish NPM + shell: bash + run: | + echo "GRADLE_OPTS = $GRADLE_OPTS" + # We can't have a separate step because each command is executed in a separate shell + # so variables exported in a command are not visible in another. + if [[ "${{ needs.set_release_type.outputs.RELEASE_TYPE }}" == "dry-run" ]]; then + export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a" + else + export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64" + fi + node ./scripts/releases-ci/publish-npm.js -t ${{ needs.set_release_type.outputs.RELEASE_TYPE }} + - name: Zip Maven Artifacts from /tmp/maven-local + working-directory: /tmp + run: zip -r maven-local.zip maven-local + - name: Upload Maven Artifacts + uses: actions/upload-artifact@v4.3.1 + with: + name: maven-local + path: /tmp/maven-local.zip + - name: Upload npm logs + uses: actions/upload-artifact@v4.3.1 + with: + name: npm-logs + path: ~/.npm/_logs + - name: Build release package as a job artifact + if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run' + run: | + mkdir -p build + + FILENAME=$(cd packages/react-native; npm pack | tail -1) + mv packages/react-native/$FILENAME build/ + + echo $FILENAME > build/react-native-package-version + - name: Upload release package + uses: actions/upload-artifact@v4.3.1 + if: needs.set_release_type.outputs.RELEASE_TYPE == 'dry-run' + with: + name: react-native-package + path: build + - name: Update rn-diff-purge to generate upgrade-support diff + if: needs.set_release_type.outputs.RELEASE_TYPE == 'release' + run: | + curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \ + -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${{ github.ref_name }}\" }}" + test_android_template: + runs-on: ubuntu-latest + needs: [prepare_hermes_workspace, build_npm_package] + container: + image: reactnativecommunity/react-native-android:latest + env: + PROJECT_NAME: AndroidTemplateProject + YARN_ENABLE_IMMUTABLE_INSTALLS: false + TERM: "dumb" + GRADLE_OPTS: '-Dorg.gradle.daemon=false' + ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a" + continue-on-error: true + strategy: + fail-fast: false + matrix: + flavor: [Debug, Release] + architecture: [ NewArch, OldArch ] + jsengine: [Hermes, JSC] + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Cache setup + id: cache_setup + uses: ./.github/actions/cache_setup + with: + hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} + react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + - name: Download npm package artifact + uses: actions/download-artifact@v4.1.3 + with: + name: react-native-package + path: build + - name: Run yarn + shell: bash + run: yarn install --non-interactive + - name: Download maven-local artifact + uses: actions/download-artifact@v4.1.3 + with: + name: maven-local + path: /tmp + - name: Unzip maven-local + working-directory: /tmp + run: unzip -q maven-local.zip + - name: Create Android template project + run: | + node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)\"}" + node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$GITHUB_WORKSPACE/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose + - name: Setup gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 8.6 + - name: Yarn install in template project + run: | + cd /tmp/$PROJECT_NAME + yarn install --non-interactive + - name: Build the template application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine. + shell: bash + run: | + sudo chmod +x /tmp/$PROJECT_NAME/node_modules/react-native/sdks/hermesc/linux64-bin/hermesc + cd /tmp/$PROJECT_NAME/android/ + if [[ ${{ matrix.architecture }} == "NewArch" ]]; then + export ORG_GRADLE_PROJECT_newArchEnabled=true + else + export ORG_GRADLE_PROJECT_newArchEnabled=false + fi + if [[ ${{ matrix.jsengine }} == "Hermes" ]]; then + export ORG_GRADLE_PROJECT_hermesEnabled=true + else + export ORG_GRADLE_PROJECT_hermesEnabled=false + fi + ./gradlew assemble${{ matrix.flavor }} -Preact.internal.mavenLocalRepo=/tmp/maven-local + - name: Upload artifact + uses: actions/upload-artifact@v4.3.1 + with: + name: template-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }} + path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/ + test_ios_template_with_ruby_3_2_0: + runs-on: macos-13 + needs: [prepare_hermes_workspace, build_npm_package] + env: + PROJECT_NAME: iOSTemplateProject + HERMES_WS_DIR: /tmp/hermes + YARN_ENABLE_IMMUTABLE_INSTALLS: false + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - uses: ./.github/actions/test_ios_template + 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] + strategy: + matrix: + flavor: [Debug, Release] + jsengine: [Hermes, JSC] + use_frameworks: [StaticLibraries, DynamicFrameworks] + exclude: + # This config is tested with Ruby 3.2.0. Let's not double test it. + - flavor: Debug + jsengine: Hermes + use_frameworks: StaticLibraries + env: + PROJECT_NAME: iOSTemplateProject + HERMES_WS_DIR: /tmp/hermes + YARN_ENABLE_IMMUTABLE_INSTALLS: false + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - uses: ./.github/actions/test_ios_template + with: + flavor: ${{ matrix.flavor }} + jsengine: ${{ matrix.jsengine }} + use-frameworks: ${{ matrix.use_frameworks }} + hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }} + react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}