From 8781c941c4dc700c6285965495d2ef16800f9372 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 6 Feb 2026 10:22:40 -0800 Subject: [PATCH 1/2] Add conditional Android/iOS job runs in test-all workflow (#55449) Summary: Further workflow optimisation after D92417918. Aims to improve speed of CI signals and reduce costs by excluding Android and iOS specific jobs when a PR contains changes exclusively within native code to one platform. Changelog: [Internal] Differential Revision: D92512983 --- .github/workflows/test-all.yml | 45 ++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 36e97a57352b2a..7c9ce78184aec1 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -37,26 +37,53 @@ jobs: runs-on: ubuntu-latest if: github.repository == 'facebook/react-native' outputs: - debugger_shell: ${{ steps.filter.outputs.debugger_shell }} - any_code_change: ${{ steps.filter.outputs.any_code_change || github.event_name != 'pull_request' }} + any_code_change: ${{ steps.filter_exclusions.outputs.any_code_change || github.event_name != 'pull_request' }} + should_test_android: ${{ steps.filter_exclusions.outputs.should_test_android || github.event_name != 'pull_request' }} + should_test_ios: ${{ steps.filter_exclusions.outputs.should_test_ios || github.event_name != 'pull_request' }} + debugger_shell: ${{ steps.filter_inclusions.outputs.debugger_shell }} steps: - name: Checkout uses: actions/checkout@v6 - - name: Check for code changes + - name: Check for code changes (exclusion patterns) uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 - id: filter + id: filter_exclusions with: + predicate-quantifier: every filters: | any_code_change: - '!**/__docs__/**' - '!**/*.md' + should_test_android: + # Not an isolated iOS change + - '!packages/react-native/React/**' + - '!packages/react-native/ReactApple/**' + - '!packages/react-native/**/*.podspec' + - '!packages/rn-tester/RNTester/**' + - '!packages/rn-tester/RNTesterPods*/**' + - '!packages/rn-tester/Podfile*' + should_test_ios: + # Not an isolated Android change + - '!gradle/**' + - '!gradle*' + - '!packages/gradle-plugin/**' + - '!packages/react-native/ReactAndroid/**' + - '!packages/react-native/**/*.gradle*' + - '!packages/react-native-popup-menu-android/**' + - '!packages/rn-tester/android/**' + - name: Check for code changes (inclusion patterns) + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 + id: filter_inclusions + with: + filters: | debugger_shell: - 'packages/debugger-shell/**' - 'scripts/debugger-shell/**' prebuild_apple_dependencies: needs: check_code_changes - if: needs.check_code_changes.outputs.any_code_change == 'true' + if: | + needs.check_code_changes.outputs.any_code_change == 'true' && + needs.check_code_changes.outputs.should_test_ios == 'true' uses: ./.github/workflows/prebuild-ios-dependencies.yml secrets: inherit @@ -83,7 +110,9 @@ jobs: test_ios_rntester_dynamic_frameworks: runs-on: macos-15-large needs: check_code_changes - if: needs.check_code_changes.outputs.any_code_change == 'true' + if: | + needs.check_code_changes.outputs.any_code_change == 'true' && + needs.check_code_changes.outputs.should_test_ios == 'true' strategy: fail-fast: false matrix: @@ -325,7 +354,9 @@ jobs: build_android: runs-on: 8-core-ubuntu needs: [set_release_type, check_code_changes] - if: needs.check_code_changes.outputs.any_code_change == 'true' + if: | + needs.check_code_changes.outputs.any_code_change == 'true' && + needs.check_code_changes.outputs.should_test_android == 'true' container: image: reactnativecommunity/react-native-android:latest env: From 6919d89865144385bd1cbaa3011c82176961f6ef Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 9 Feb 2026 20:34:50 +0000 Subject: [PATCH 2/2] Fix dorny/paths-filter pin to include predicate-quantifier in action.yml (#1) --- .github/workflows/test-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 7c9ce78184aec1..9771f1e8677bbf 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -45,7 +45,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 - name: Check for code changes (exclusion patterns) - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 + uses: dorny/paths-filter@209e61402dbca8aa44f967535da6666b284025ed id: filter_exclusions with: predicate-quantifier: every @@ -71,7 +71,7 @@ jobs: - '!packages/react-native-popup-menu-android/**' - '!packages/rn-tester/android/**' - name: Check for code changes (inclusion patterns) - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 + uses: dorny/paths-filter@209e61402dbca8aa44f967535da6666b284025ed id: filter_inclusions with: filters: |