From b2b446e71133b3cde8323e08db06432a8ee0ec0c Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 6 Feb 2026 04:25:32 -0800 Subject: [PATCH] Apply path filtering checks to test-all workflow (#55429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55429 Completes this stack of diffs focused around the organisation and efficiency of the `test-all` GitHub Actions workflow. **Changed** All root jobs (excluding `lint`), when running against a PR, now depend on the initial `check_code_changes` job. This matches any non-Markdown, non docs change — meaning trivial PRs such as changelog updates should now avoid unnecessarily running the expensive parts of this workflow. IMPORTANT: This is a significant change at the root of the workflow that contributes to our prebuilts/release infra — please review carefully. **The new `any_code_change` filter** Extremely defensive: - Matches `'!**/__docs__/**', '!**/*.md'` only. - Also **always** sets `any_code_change` to true if on `main`, a release branch, or on a workflow dispatch (`github.event_name != 'pull_request'`). Changelog: [Internal] Reviewed By: cortinico Differential Revision: D92417918 fbshipit-source-id: ca5bc41a3c11569b8f69062ab66eeeab89d30089 --- .github/workflows/test-all.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 79dec9cfd0e..ab159429d2f 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -38,6 +38,7 @@ jobs: 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' }} steps: - name: Checkout uses: actions/checkout@v6 @@ -46,12 +47,16 @@ jobs: id: filter with: filters: | + any_code_change: + - '!**/__docs__/**' + - '!**/*.md' debugger_shell: - 'packages/debugger-shell/**' - 'scripts/debugger-shell/**' prebuild_apple_dependencies: - if: github.repository == 'facebook/react-native' + needs: check_code_changes + if: needs.check_code_changes.outputs.any_code_change == 'true' uses: ./.github/workflows/prebuild-ios-dependencies.yml secrets: inherit @@ -77,6 +82,8 @@ 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' strategy: fail-fast: false matrix: @@ -297,7 +304,8 @@ jobs: run_fantom_tests: runs-on: 8-core-ubuntu - needs: [set_release_type] + needs: [set_release_type, check_code_changes] + if: needs.check_code_changes.outputs.any_code_change == 'true' container: image: reactnativecommunity/react-native-android:latest env: @@ -316,7 +324,8 @@ jobs: build_android: runs-on: 8-core-ubuntu - needs: [set_release_type] + needs: [set_release_type, check_code_changes] + if: needs.check_code_changes.outputs.any_code_change == 'true' container: image: reactnativecommunity/react-native-android:latest env: @@ -518,7 +527,8 @@ jobs: test_js: runs-on: ubuntu-latest - needs: lint + needs: [check_code_changes, lint] + if: needs.check_code_changes.outputs.any_code_change == 'true' strategy: fail-fast: false matrix: @@ -533,7 +543,8 @@ jobs: build_js_types: runs-on: ubuntu-latest - needs: lint + needs: [check_code_changes, lint] + if: needs.check_code_changes.outputs.any_code_change == 'true' steps: - name: Checkout uses: actions/checkout@v6