Skip to content

Commit b2b446e

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Apply path filtering checks to test-all workflow (#55429)
Summary: Pull Request resolved: #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
1 parent 8067f7b commit b2b446e

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/test-all.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
if: github.repository == 'facebook/react-native'
3939
outputs:
4040
debugger_shell: ${{ steps.filter.outputs.debugger_shell }}
41+
any_code_change: ${{ steps.filter.outputs.any_code_change || github.event_name != 'pull_request' }}
4142
steps:
4243
- name: Checkout
4344
uses: actions/checkout@v6
@@ -46,12 +47,16 @@ jobs:
4647
id: filter
4748
with:
4849
filters: |
50+
any_code_change:
51+
- '!**/__docs__/**'
52+
- '!**/*.md'
4953
debugger_shell:
5054
- 'packages/debugger-shell/**'
5155
- 'scripts/debugger-shell/**'
5256
5357
prebuild_apple_dependencies:
54-
if: github.repository == 'facebook/react-native'
58+
needs: check_code_changes
59+
if: needs.check_code_changes.outputs.any_code_change == 'true'
5560
uses: ./.github/workflows/prebuild-ios-dependencies.yml
5661
secrets: inherit
5762

@@ -77,6 +82,8 @@ jobs:
7782

7883
test_ios_rntester_dynamic_frameworks:
7984
runs-on: macos-15-large
85+
needs: check_code_changes
86+
if: needs.check_code_changes.outputs.any_code_change == 'true'
8087
strategy:
8188
fail-fast: false
8289
matrix:
@@ -297,7 +304,8 @@ jobs:
297304

298305
run_fantom_tests:
299306
runs-on: 8-core-ubuntu
300-
needs: [set_release_type]
307+
needs: [set_release_type, check_code_changes]
308+
if: needs.check_code_changes.outputs.any_code_change == 'true'
301309
container:
302310
image: reactnativecommunity/react-native-android:latest
303311
env:
@@ -316,7 +324,8 @@ jobs:
316324

317325
build_android:
318326
runs-on: 8-core-ubuntu
319-
needs: [set_release_type]
327+
needs: [set_release_type, check_code_changes]
328+
if: needs.check_code_changes.outputs.any_code_change == 'true'
320329
container:
321330
image: reactnativecommunity/react-native-android:latest
322331
env:
@@ -518,7 +527,8 @@ jobs:
518527

519528
test_js:
520529
runs-on: ubuntu-latest
521-
needs: lint
530+
needs: [check_code_changes, lint]
531+
if: needs.check_code_changes.outputs.any_code_change == 'true'
522532
strategy:
523533
fail-fast: false
524534
matrix:
@@ -533,7 +543,8 @@ jobs:
533543

534544
build_js_types:
535545
runs-on: ubuntu-latest
536-
needs: lint
546+
needs: [check_code_changes, lint]
547+
if: needs.check_code_changes.outputs.any_code_change == 'true'
537548
steps:
538549
- name: Checkout
539550
uses: actions/checkout@v6

0 commit comments

Comments
 (0)