diff --git a/.github/actions/build-android/action.yml b/.github/actions/build-android/action.yml index 6856221dc57..4e33472eb02 100644 --- a/.github/actions/build-android/action.yml +++ b/.github/actions/build-android/action.yml @@ -4,6 +4,9 @@ inputs: release-type: required: true description: The type of release we are building. It could be nightly, release or dry-run + run-e2e-tests: + default: 'false' + description: If we need to build to run E2E tests. If yes, we need to build also x86. runs: using: composite steps: @@ -34,7 +37,11 @@ runs: run: | if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then # dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs. - export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing + if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then + export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing + else + export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a" + fi TASKS="publishAllToMavenTempLocal build" elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then # nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central. diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index bf2a35d9446..3987ce6877b 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -180,6 +180,7 @@ jobs: react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }} test_e2e_ios_rntester: + if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') }} runs-on: macos-13 needs: [build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos] @@ -214,6 +215,7 @@ jobs: maestro-flow: ./packages/rn-tester/.maestro/ test_e2e_ios_templateapp: + if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') }} runs-on: macos-13 needs: build_npm_package env: @@ -280,6 +282,7 @@ jobs: maestro-flow: ./scripts/e2e/.maestro/ test_e2e_android_templateapp: + if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') }} runs-on: ubuntu-latest needs: build_npm_package continue-on-error: true @@ -389,8 +392,10 @@ jobs: uses: ./.github/actions/build-android with: release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }} + run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') }} test_e2e_android_rntester: + if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') }} runs-on: ubuntu-latest needs: [build_android] strategy: