From 1b0338096ec155df4d153ec92771f917230ec813 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 30 Nov 2026 11:04:21 +0000 Subject: [PATCH 1/2] Add required native builds CI gate --- .github/workflows/test-all.yml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 825887470456..63948f2f6e25 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -675,3 +675,51 @@ jobs: - name: Verify debugger-shell build shell: bash run: node scripts/debugger-shell/build-binary.js + + # Require this job in branch protection instead of a platform-specific build. + # Unlike the builds, it reports a result even when a platform is intentionally skipped. + native_builds: + runs-on: ubuntu-latest + needs: [check_code_changes, build_android, test_ios_rntester] + if: ${{ always() && github.repository == 'react/react-native' }} + steps: + - name: Verify required native builds + shell: bash + env: + CODE_CHANGES_RESULT: ${{ needs.check_code_changes.result }} + ANY_CODE_CHANGE: ${{ needs.check_code_changes.outputs.any_code_change }} + SHOULD_TEST_ANDROID: ${{ needs.check_code_changes.outputs.should_test_android }} + SHOULD_TEST_IOS: ${{ needs.check_code_changes.outputs.should_test_ios }} + ANDROID_RESULT: ${{ needs.build_android.result }} + IOS_RESULT: ${{ needs.test_ios_rntester.result }} + run: | + set -e + + if [[ "$CODE_CHANGES_RESULT" != success ]]; then + echo "::error::Could not determine which native builds are required ($CODE_CHANGES_RESULT)" + exit 1 + fi + + check_build() { + local platform="$1" required="$2" result="$3" + if [[ "$required" == true ]]; then + if [[ "$result" != success ]]; then + echo "::error::$platform build required but finished with $result" + return 1 + fi + elif [[ "$result" != skipped && "$result" != success ]]; then + echo "::error::$platform build was not required but finished with $result" + return 1 + fi + echo "$platform build: $result (required: $required)" + } + + android_required=false + ios_required=false + if [[ "$ANY_CODE_CHANGE" == true ]]; then + android_required="$SHOULD_TEST_ANDROID" + ios_required="$SHOULD_TEST_IOS" + fi + + check_build Android "$android_required" "$ANDROID_RESULT" + check_build iOS "$ios_required" "$IOS_RESULT" From fd8edec47c2ec5b990636bf3733d42dfbfb0dd27 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 30 Nov 2026 11:06:07 +0000 Subject: [PATCH 2/2] Rename native builds gate check --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 63948f2f6e25..4b0b40d1ac19 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -678,7 +678,7 @@ jobs: # Require this job in branch protection instead of a platform-specific build. # Unlike the builds, it reports a result even when a platform is intentionally skipped. - native_builds: + native_builds_gate: runs-on: ubuntu-latest needs: [check_code_changes, build_android, test_ios_rntester] if: ${{ always() && github.repository == 'react/react-native' }}