Skip to content

Commit 74626bd

Browse files
committed
[ci] Run Android and iOS tests as their own workflows
1 parent 89278de commit 74626bd

11 files changed

Lines changed: 218 additions & 131 deletions

File tree

‎.github/workflow-scripts/upload-test-results.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This source code is licensed under the MIT license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
# Copies Test All's test results for one run attempt to GCS, for
7+
# Copies a test workflow's test results for one run attempt to GCS, for
88
# upload-test-results.yml. Artifacts, including those from forks, are treated
99
# as inert data: only each one's results.json is copied, after validation, and
1010
# nothing in them is executed.

‎.github/workflows/test-all.yml‎

Lines changed: 8 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Test All
33
on:
44
workflow_dispatch:
55
pull_request:
6+
paths-ignore:
7+
- '**/*.md'
8+
- '**/__docs__/**'
9+
- '**/LICENSE'
610
push:
711
branches:
812
- main
@@ -20,80 +24,9 @@ concurrency:
2024
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2125

2226
jobs:
23-
check_code_changes:
24-
runs-on: ubuntu-latest
25-
if: github.repository == 'react/react-native'
26-
outputs:
27-
any_code_change: ${{ steps.filter_exclusions.outputs.any_code_change == 'true' || github.event_name != 'pull_request' }}
28-
should_test_android: ${{ steps.filter_exclusions.outputs.should_test_android == 'true' || github.event_name != 'pull_request' }}
29-
should_test_ios: ${{ steps.filter_exclusions.outputs.should_test_ios == 'true' || github.event_name != 'pull_request' }}
30-
debugger_shell: ${{ steps.filter_inclusions.outputs.debugger_shell }}
31-
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v6
34-
- name: Check for code changes (exclusion patterns)
35-
uses: dorny/paths-filter@209e61402dbca8aa44f967535da6666b284025ed
36-
id: filter_exclusions
37-
with:
38-
predicate-quantifier: every
39-
filters: |
40-
any_code_change:
41-
- '**'
42-
- '!**/__docs__/**'
43-
- '!**/*.md'
44-
- '!**/LICENSE'
45-
should_test_android:
46-
# Not an isolated iOS change
47-
- '**'
48-
- '!packages/react-native/React/**'
49-
- '!packages/react-native/ReactApple/**'
50-
- '!packages/react-native/**/*.m'
51-
- '!packages/react-native/**/*.mm'
52-
- '!packages/react-native/**/*.podspec'
53-
- '!packages/rn-tester/RNTester/**'
54-
- '!packages/rn-tester/RNTesterPods*/**'
55-
- '!packages/rn-tester/Podfile*'
56-
should_test_ios:
57-
# Not an isolated Android change
58-
- '**'
59-
- '!gradle/**'
60-
- '!gradle*'
61-
- '!packages/gradle-plugin/**'
62-
- '!packages/react-native/ReactAndroid/**'
63-
- '!packages/react-native/**/*.java'
64-
- '!packages/react-native/**/*.kt'
65-
- '!packages/react-native/**/*.gradle*'
66-
- '!packages/react-native-popup-menu-android/**'
67-
- '!packages/rn-tester/android/**'
68-
- name: Check for code changes (inclusion patterns)
69-
uses: dorny/paths-filter@209e61402dbca8aa44f967535da6666b284025ed
70-
id: filter_inclusions
71-
with:
72-
filters: |
73-
debugger_shell:
74-
- 'packages/debugger-shell/**'
75-
- 'scripts/debugger-shell/**'
76-
77-
test_android:
78-
needs: check_code_changes
79-
if: |
80-
needs.check_code_changes.outputs.any_code_change == 'true' &&
81-
needs.check_code_changes.outputs.should_test_android == 'true'
82-
uses: ./.github/workflows/test-android.yml
83-
secrets: inherit
84-
85-
test_ios:
86-
needs: check_code_changes
87-
if: |
88-
needs.check_code_changes.outputs.any_code_change == 'true' &&
89-
needs.check_code_changes.outputs.should_test_ios == 'true'
90-
uses: ./.github/workflows/test-ios.yml
91-
secrets: inherit
92-
9327
build_fantom_runner:
9428
runs-on: 8-core-ubuntu
95-
needs: [check_code_changes, lint]
96-
if: needs.check_code_changes.outputs.any_code_change == 'true'
29+
needs: lint
9730
container:
9831
image: reactnativecommunity/react-native-android:latest
9932
env:
@@ -135,8 +68,7 @@ jobs:
13568

13669
test_react_common_cxx:
13770
runs-on: 8-core-ubuntu
138-
needs: [check_code_changes, lint]
139-
if: needs.check_code_changes.outputs.any_code_change == 'true'
71+
needs: lint
14072
container:
14173
image: reactnativecommunity/react-native-android:latest
14274
env:
@@ -215,8 +147,7 @@ jobs:
215147

216148
test_js:
217149
runs-on: ubuntu-latest
218-
needs: [check_code_changes, lint]
219-
if: needs.check_code_changes.outputs.any_code_change == 'true'
150+
needs: lint
220151
strategy:
221152
fail-fast: false
222153
matrix:
@@ -231,8 +162,7 @@ jobs:
231162

232163
build_js_types:
233164
runs-on: ubuntu-latest
234-
needs: [check_code_changes, lint]
235-
if: needs.check_code_changes.outputs.any_code_change == 'true'
165+
needs: lint
236166
steps:
237167
- name: Checkout
238168
uses: actions/checkout@v6
@@ -246,21 +176,3 @@ jobs:
246176
- name: Validate generated types
247177
shell: bash
248178
run: yarn test-generated-typescript
249-
250-
build_debugger_shell:
251-
runs-on: macos-26
252-
needs: check_code_changes
253-
if: needs.check_code_changes.outputs.debugger_shell == 'true'
254-
steps:
255-
- name: Checkout
256-
uses: actions/checkout@v6
257-
- name: Setup Node.js
258-
uses: ./.github/actions/setup-node
259-
- name: Install dependencies
260-
uses: ./.github/actions/yarn-install
261-
- name: Build packages
262-
shell: bash
263-
run: yarn build --prepack
264-
- name: Verify debugger-shell build
265-
shell: bash
266-
run: node scripts/debugger-shell/build-binary.js

‎.github/workflows/test-android.yml‎

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,82 @@
11
name: Test Android
22

33
on:
4-
workflow_call:
4+
workflow_dispatch:
5+
pull_request:
6+
# A pull request whose changed files all match these patterns doesn't
7+
# need this platform tested.
8+
paths-ignore:
9+
# Not code
10+
- '**/*.md'
11+
- '**/__docs__/**'
12+
- '**/LICENSE'
13+
# Apple sources and build files
14+
- 'packages/react-native/React/**'
15+
- 'packages/react-native/ReactApple/**'
16+
- 'packages/react-native/Libraries/**/*.h'
17+
- '**/*.m'
18+
- '**/*.mm'
19+
- '**/*.swift'
20+
- '**/*.podspec'
21+
- '**/*.rb'
22+
- '**/*.ios.js'
23+
- '**/Gemfile'
24+
- '**/Gemfile.lock'
25+
- '**/Podfile'
26+
- '**/Podfile.lock'
27+
- '**/.xcode.env'
28+
- '**/*.xcodeproj/**'
29+
- '**/*.xcworkspace/**'
30+
- '**/ios/**'
31+
- '**/apple/**'
32+
- 'packages/rn-tester/RNTester*/**'
33+
# CocoaPods, SwiftPM and prebuild tooling
34+
- 'packages/react-native/scripts/cocoapods/**'
35+
- 'packages/react-native/scripts/ios-prebuild/**'
36+
- 'packages/react-native/scripts/react_native_pods_utils/**'
37+
- 'packages/react-native/scripts/spm/**'
38+
- 'packages/react-native/scripts/swiftpm/**'
39+
- 'packages/react-native/scripts/xcode/**'
40+
- 'packages/react-native/scripts/ios-prebuild.js'
41+
- 'packages/react-native/scripts/react-native-xcode.sh'
42+
- 'packages/react-native/scripts/setup-apple-spm.js'
43+
- 'packages/react-native/third-party-podspecs/**'
44+
- 'scripts/process-podspecs.sh'
45+
- 'scripts/releases/ios-prebuild/**'
46+
- 'scripts/releases/prepare-ios-prebuilds.js'
47+
- 'scripts/validate-ios-test-env.sh'
48+
# iOS CI
49+
- '.github/workflows/test-all.yml'
50+
- '.github/workflows/bump-podfile-lock.yml'
51+
- '.github/workflows/e2e-ios-*.yml'
52+
- '.github/workflows/prebuild-ios-*.yml'
53+
- '.github/workflows/test-ios.yml'
54+
- '.github/workflows/test-ios-spm-newapp.yml'
55+
- '.github/actions/maestro-ios/**'
56+
- '.github/actions/prepare-ios-tests/**'
57+
- '.github/actions/setup-spm-artifacts/**'
58+
- '.github/actions/setup-xcode/**'
59+
- '.github/actions/test-ios-helloworld/**'
60+
- '.github/actions/test-ios-rntester/**'
61+
push:
62+
branches:
63+
- main
64+
- '*-stable'
65+
66+
permissions:
67+
contents: read
68+
actions: read
69+
70+
concurrency:
71+
# A new push to a pull request makes the previous run obsolete, so cancel it
72+
# instead of spending (macOS) runner time on it. Runs on branches are never
73+
# cancelled: each one gets its own group.
74+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
75+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
576

677
jobs:
778
build_android:
79+
if: github.repository == 'react/react-native'
880
runs-on: 8-core-ubuntu
981
container:
1082
image: reactnativecommunity/react-native-android:latest
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test Debugger Shell
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- 'packages/debugger-shell/**'
8+
- 'scripts/debugger-shell/**'
9+
push:
10+
branches:
11+
- main
12+
- '*-stable'
13+
paths:
14+
- 'packages/debugger-shell/**'
15+
- 'scripts/debugger-shell/**'
16+
17+
permissions:
18+
contents: read
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
22+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
23+
24+
jobs:
25+
build_debugger_shell:
26+
runs-on: macos-26
27+
if: github.repository == 'react/react-native'
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v6
31+
- name: Setup Node.js
32+
uses: ./.github/actions/setup-node
33+
- name: Install dependencies
34+
uses: ./.github/actions/yarn-install
35+
- name: Build packages
36+
shell: bash
37+
run: yarn build --prepack
38+
- name: Verify debugger-shell build
39+
shell: bash
40+
run: node scripts/debugger-shell/build-binary.js

‎.github/workflows/test-ios.yml‎

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,56 @@
11
name: Test iOS
22

33
on:
4-
workflow_call:
4+
workflow_dispatch:
5+
pull_request:
6+
# A pull request whose changed files all match these patterns doesn't
7+
# need this platform tested.
8+
paths-ignore:
9+
# Not code
10+
- '**/*.md'
11+
- '**/__docs__/**'
12+
- '**/LICENSE'
13+
# Android sources and build files
14+
- 'packages/react-native/ReactAndroid/**'
15+
- 'packages/gradle-plugin/**'
16+
- 'packages/react-native-popup-menu-android/**'
17+
- '**/*.java'
18+
- '**/*.kt'
19+
- '**/*.kts'
20+
- '**/*.gradle'
21+
- '**/*.android.js'
22+
- '**/gradlew'
23+
- '**/gradlew.bat'
24+
- '**/gradle.properties'
25+
- '**/gradle/**'
26+
- '**/android/**'
27+
# Android CI
28+
- '.github/workflows/test-all.yml'
29+
- '.github/workflows/build-android-templateapp.yml'
30+
- '.github/workflows/e2e-android-*.yml'
31+
- '.github/workflows/test-android.yml'
32+
- '.github/actions/build-android/**'
33+
- '.github/actions/maestro-android/**'
34+
- '.github/actions/setup-gradle/**'
35+
push:
36+
branches:
37+
- main
38+
- '*-stable'
39+
40+
permissions:
41+
contents: read
42+
actions: read
43+
44+
concurrency:
45+
# A new push to a pull request makes the previous run obsolete, so cancel it
46+
# instead of spending (macOS) runner time on it. Runs on branches are never
47+
# cancelled: each one gets its own group.
48+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
49+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
550

651
jobs:
752
prebuild_apple_dependencies:
53+
if: github.repository == 'react/react-native'
854
uses: ./.github/workflows/prebuild-ios-dependencies.yml
955
secrets: inherit
1056

‎.github/workflows/upload-test-results.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# Copies Test All's test result artifacts, plus a description of the run, to
2-
# GCS for test history. Runs from the default branch after every Test All run,
1+
# Copies the test result artifacts of a test workflow run, plus a description
2+
# of the run, to GCS for test history. Runs from the default branch after every
3+
# Test All, Test Android and Test iOS run,
34
# including pull requests from forks. The artifacts are copied as inert data:
45
# nothing in them is executed, and they are validated where they're read.
56
name: Upload Test Results
67

78
on:
89
workflow_run:
9-
workflows: [Test All]
10+
workflows: [Test All, Test Android, Test iOS]
1011
types: [completed]
1112

1213
permissions: {}

‎.github/workflows/visual-capture-rntester.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Untrusted half of RNTester visual regression testing. Called from Test All
2-
# once the RNTester Release build for a platform is ready, it captures the
1+
# Untrusted half of RNTester visual regression testing. Called from Test
2+
# Android and Test iOS once the RNTester Release build is ready, it captures the
33
# visual flows on one canonical device and uploads the PNGs plus a manifest as
44
# an artifact. It has no secrets and no storage access: comparison and
55
# publication happen in visual-compare-rntester.yml, which runs from the
6-
# default branch when Test All completes.
6+
# default branch when the calling workflow completes.
77
name: Visual Capture RNTester
88

99
on:

‎.github/workflows/visual-compare-rntester.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Trusted half of RNTester visual regression testing. Runs from the default
2-
# branch after Test All completes, including for pull requests from forks, and
3-
# compares whatever visual-capture-rntester.yml captured in that run. The
2+
# branch after Test Android or Test iOS completes, including for pull requests
3+
# from forks, and compares whatever visual-capture-rntester.yml captured in
4+
# that run. The
45
# capture artifacts are treated as inert data: they are validated before any
56
# image is decoded, and nothing in them is executed.
67
#
@@ -12,7 +13,7 @@ name: Visual Compare RNTester
1213

1314
on:
1415
workflow_run:
15-
workflows: [Test All]
16+
workflows: [Test Android, Test iOS]
1617
types: [completed]
1718

1819
permissions:
@@ -33,7 +34,7 @@ env:
3334

3435
jobs:
3536
find_captures:
36-
# Test All can fail for reasons unrelated to rendering, so a failed run is
37+
# A test run can fail for reasons unrelated to rendering, so a failed run is
3738
# still compared. A platform with no capture is reported as such. Pushes
3839
# to other branches have no baseline to compare with or publish. Pull
3940
# requests into other branches are skipped in compare-run.js, because

0 commit comments

Comments
 (0)