Skip to content

Commit b3ea6d0

Browse files
committed
[ci] Split Test All into Android and iOS workflows
1 parent b12d8ea commit b3ea6d0

6 files changed

Lines changed: 356 additions & 327 deletions

File tree

‎.github/actions/build-npm-package/action.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
description: When true, skip downloading prebuilt Apple artifacts (use when Apple prebuild jobs were skipped)
1111
required: false
1212
default: 'false'
13+
artifact-suffix:
14+
description: Appended to the names of the uploaded artifacts, so several package builds can run in one workflow run
15+
required: false
16+
default: ''
1317

1418
runs:
1519
using: composite
@@ -79,7 +83,7 @@ runs:
7983
- name: Upload npm logs
8084
uses: ./.github/actions/upload-artifact
8185
with:
82-
name: npm-logs
86+
name: npm-logs${{ inputs.artifact-suffix }}
8387
path: ~/.npm/_logs
8488
- name: Build release package as a job artifact
8589
if: ${{ inputs.release-type == 'dry-run' }}
@@ -95,5 +99,5 @@ runs:
9599
uses: ./.github/actions/upload-artifact
96100
if: ${{ inputs.release-type == 'dry-run' }}
97101
with:
98-
name: react-native-package
102+
name: react-native-package${{ inputs.artifact-suffix }}
99103
path: build

‎.github/workflows/build-android-templateapp.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Download React Native Package
3838
uses: ./.github/actions/download-artifact
3939
with:
40-
name: react-native-package
40+
name: react-native-package-android
4141
path: /tmp/react-native-tmp
4242
- name: Build template app
4343
shell: bash

‎.github/workflows/e2e-android-templateapp.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
if: matrix.flavor == 'debug'
4343
uses: ./.github/actions/download-artifact
4444
with:
45-
name: react-native-package
45+
name: react-native-package-android
4646
path: /tmp/react-native-tmp
4747
- name: Prepare Metro workspace
4848
if: matrix.flavor == 'debug'

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

Lines changed: 12 additions & 323 deletions
Original file line numberDiff line numberDiff line change
@@ -98,144 +98,24 @@ jobs:
9898
- 'packages/debugger-shell/**'
9999
- 'scripts/debugger-shell/**'
100100
101-
prebuild_apple_dependencies:
102-
needs: check_code_changes
101+
test_android:
102+
needs: [set_release_type, check_code_changes]
103103
if: |
104104
needs.check_code_changes.outputs.any_code_change == 'true' &&
105-
needs.check_code_changes.outputs.should_test_ios == 'true'
106-
uses: ./.github/workflows/prebuild-ios-dependencies.yml
107-
secrets: inherit
108-
109-
prebuild_react_native_core:
110-
uses: ./.github/workflows/prebuild-ios-core.yml
111-
if: ${{ needs.prebuild_apple_dependencies.result == 'success' }}
112-
with:
113-
use-hermes-prebuilt: ${{ !endsWith(github.ref_name, '-stable') }}
114-
secrets: inherit
115-
needs: [prebuild_apple_dependencies]
116-
117-
test_ios_rntester:
118-
runs-on: macos-15-large
119-
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
120-
if: ${{ needs.prebuild_react_native_core.result == 'success' }}
121-
strategy:
122-
fail-fast: false
123-
matrix:
124-
flavor: [Debug, Release]
125-
steps:
126-
- name: Checkout
127-
uses: actions/checkout@v6
128-
- name: Run it
129-
uses: ./.github/actions/test-ios-rntester
130-
with:
131-
flavor: ${{ matrix.flavor }}
132-
133-
# The CocoaPods opt-out stays supported, so CI keeps one CocoaPods build per test app.
134-
test_ios_rntester_cocoapods:
135-
runs-on: macos-15-large
136-
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
137-
if: ${{ needs.prebuild_react_native_core.result == 'success' }}
138-
steps:
139-
- name: Checkout
140-
uses: actions/checkout@v6
141-
- name: Run it
142-
uses: ./.github/actions/test-ios-rntester
143-
with:
144-
flavor: Debug
145-
dependency-manager: cocoapods
146-
147-
test_e2e_ios_rntester:
148-
needs: test_ios_rntester
149-
if: ${{ needs.test_ios_rntester.result == 'success' }}
150-
uses: ./.github/workflows/e2e-ios-rntester.yml
151-
secrets: inherit
152-
153-
# Each flow already gets a retry inside the job, so a flow that failed is
154-
# reported straight away. These retries only re-run jobs that stopped before
155-
# running every flow, and they skip flows that already passed.
156-
test_e2e_ios_rntester_retry_1:
157-
needs: test_e2e_ios_rntester
158-
if: ${{ always() && needs.test_e2e_ios_rntester.outputs.retryable == 'true' }}
159-
uses: ./.github/workflows/e2e-ios-rntester.yml
160-
with:
161-
retry-attempt: 1
162-
secrets: inherit
163-
164-
test_e2e_ios_rntester_retry_2:
165-
needs: test_e2e_ios_rntester_retry_1
166-
if: ${{ always() && needs.test_e2e_ios_rntester_retry_1.outputs.retryable == 'true' }}
167-
uses: ./.github/workflows/e2e-ios-rntester.yml
168-
with:
169-
fail-on-error: true
170-
retry-attempt: 2
171-
secrets: inherit
172-
173-
test_visual_ios_rntester:
174-
needs: test_ios_rntester
175-
if: ${{ needs.test_ios_rntester.result == 'success' }}
176-
uses: ./.github/workflows/visual-capture-rntester.yml
177-
with:
178-
platform: ios
179-
180-
test_e2e_ios_templateapp:
181-
needs: [build_npm_package, prebuild_apple_dependencies, check_code_changes]
182-
if: needs.check_code_changes.outputs.should_test_ios == 'true'
183-
uses: ./.github/workflows/e2e-ios-templateapp.yml
184-
secrets: inherit
185-
186-
test_e2e_ios_templateapp_retry_1:
187-
needs: test_e2e_ios_templateapp
188-
if: ${{ always() && needs.test_e2e_ios_templateapp.outputs.status == 'failure' }}
189-
uses: ./.github/workflows/e2e-ios-templateapp.yml
190-
secrets: inherit
191-
192-
test_e2e_ios_templateapp_retry_2:
193-
needs: test_e2e_ios_templateapp_retry_1
194-
if: ${{ always() && needs.test_e2e_ios_templateapp_retry_1.outputs.status == 'failure' }}
195-
uses: ./.github/workflows/e2e-ios-templateapp.yml
196-
with:
197-
fail-on-error: true
198-
secrets: inherit
199-
200-
test_ios_spm_newapp:
201-
needs:
202-
[
203-
build_npm_package,
204-
prebuild_apple_dependencies,
205-
prebuild_react_native_core,
206-
check_code_changes,
207-
]
208-
if: ${{ needs.prebuild_react_native_core.result == 'success' && needs.build_npm_package.result == 'success' && needs.check_code_changes.outputs.should_test_ios == 'true' }}
209-
uses: ./.github/workflows/test-ios-spm-newapp.yml
210-
secrets: inherit
211-
212-
build_android_templateapp:
213-
needs: [build_npm_package, build_android]
214-
if: ${{ always() && needs.build_android.result == 'success' && needs.build_npm_package.result == 'success' }}
215-
uses: ./.github/workflows/build-android-templateapp.yml
216-
secrets: inherit
217-
218-
test_e2e_android_templateapp:
219-
needs: build_android_templateapp
220-
if: ${{ needs.build_android_templateapp.result == 'success' }}
221-
uses: ./.github/workflows/e2e-android-templateapp.yml
222-
secrets: inherit
223-
224-
test_e2e_android_templateapp_retry_1:
225-
needs: test_e2e_android_templateapp
226-
if: ${{ always() && needs.test_e2e_android_templateapp.outputs.status == 'failure' }}
227-
uses: ./.github/workflows/e2e-android-templateapp.yml
105+
needs.check_code_changes.outputs.should_test_android == 'true'
106+
uses: ./.github/workflows/test-android.yml
228107
with:
229-
retry-attempt: 1
108+
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
230109
secrets: inherit
231110

232-
test_e2e_android_templateapp_retry_2:
233-
needs: test_e2e_android_templateapp_retry_1
234-
if: ${{ always() && needs.test_e2e_android_templateapp_retry_1.outputs.status == 'failure' }}
235-
uses: ./.github/workflows/e2e-android-templateapp.yml
111+
test_ios:
112+
needs: [set_release_type, check_code_changes]
113+
if: |
114+
needs.check_code_changes.outputs.any_code_change == 'true' &&
115+
needs.check_code_changes.outputs.should_test_ios == 'true'
116+
uses: ./.github/workflows/test-ios.yml
236117
with:
237-
fail-on-error: true
238-
retry-attempt: 2
118+
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
239119
secrets: inherit
240120

241121
build_fantom_runner:
@@ -335,197 +215,6 @@ jobs:
335215
if-no-files-found: ignore
336216
path: private/react-native-fantom/build/reports
337217

338-
build_android:
339-
runs-on: 8-core-ubuntu
340-
needs: [set_release_type, check_code_changes]
341-
if: |
342-
needs.check_code_changes.outputs.any_code_change == 'true' &&
343-
needs.check_code_changes.outputs.should_test_android == 'true'
344-
container:
345-
image: reactnativecommunity/react-native-android:latest
346-
env:
347-
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in containers
348-
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127
349-
LC_ALL: C.UTF8
350-
TERM: 'dumb'
351-
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
352-
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
353-
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
354-
REACT_NATIVE_DOWNLOADS_DIR: /opt/react-native-downloads
355-
steps:
356-
- name: Checkout
357-
uses: actions/checkout@v6
358-
- name: Build Android
359-
uses: ./.github/actions/build-android
360-
with:
361-
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
362-
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
363-
364-
test_e2e_android_rntester:
365-
needs: build_android
366-
if: ${{ needs.build_android.result == 'success' }}
367-
uses: ./.github/workflows/e2e-android-rntester.yml
368-
secrets: inherit
369-
370-
test_e2e_android_rntester_retry_1:
371-
needs: test_e2e_android_rntester
372-
if: ${{ always() && needs.test_e2e_android_rntester.outputs.status == 'failure' }}
373-
uses: ./.github/workflows/e2e-android-rntester.yml
374-
with:
375-
retry-attempt: 1
376-
secrets: inherit
377-
378-
test_e2e_android_rntester_retry_2:
379-
needs: test_e2e_android_rntester_retry_1
380-
if: ${{ always() && needs.test_e2e_android_rntester_retry_1.outputs.status == 'failure' }}
381-
uses: ./.github/workflows/e2e-android-rntester.yml
382-
with:
383-
fail-on-error: true
384-
retry-attempt: 2
385-
secrets: inherit
386-
387-
test_visual_android_rntester:
388-
needs: build_android
389-
if: ${{ needs.build_android.result == 'success' }}
390-
uses: ./.github/workflows/visual-capture-rntester.yml
391-
with:
392-
platform: android
393-
394-
build_npm_package:
395-
runs-on: 8-core-ubuntu
396-
needs:
397-
[
398-
set_release_type,
399-
check_code_changes,
400-
build_android,
401-
prebuild_apple_dependencies,
402-
prebuild_react_native_core,
403-
]
404-
if: |
405-
always() &&
406-
!contains(needs.*.result, 'failure') &&
407-
!contains(needs.*.result, 'cancelled') &&
408-
(needs.build_android.result == 'success' ||
409-
needs.prebuild_apple_dependencies.result == 'success' ||
410-
needs.prebuild_react_native_core.result == 'success')
411-
container:
412-
image: reactnativecommunity/react-native-android:latest
413-
env:
414-
TERM: 'dumb'
415-
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in containers
416-
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127
417-
LC_ALL: C.UTF8
418-
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
419-
REACT_NATIVE_DOWNLOADS_DIR: /opt/react-native-downloads
420-
steps:
421-
- name: Checkout
422-
uses: actions/checkout@v6
423-
- name: Build NPM Package
424-
uses: ./.github/actions/build-npm-package
425-
with:
426-
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
427-
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
428-
skip-apple-prebuilts: ${{ needs.check_code_changes.outputs.should_test_ios == 'false' }}
429-
430-
test_android_helloworld:
431-
runs-on: 4-core-ubuntu
432-
needs: [build_npm_package, build_android]
433-
if: ${{ always() && needs.build_android.result == 'success' && needs.build_npm_package.result == 'success' }}
434-
container:
435-
image: reactnativecommunity/react-native-android:latest
436-
env:
437-
# Set the encoding to resolve a known character encoding issue with decompressing tar.gz files in conatiners
438-
# via Gradle: https://github.com/gradle/gradle/issues/23391#issuecomment-1878979127
439-
LC_ALL: C.UTF8
440-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
441-
TERM: 'dumb'
442-
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
443-
TARGET_ARCHITECTURE: 'arm64-v8a'
444-
REACT_NATIVE_DOWNLOADS_DIR: /opt/react-native-downloads
445-
continue-on-error: true
446-
strategy:
447-
fail-fast: false
448-
matrix:
449-
flavor: [Debug, Release]
450-
steps:
451-
- name: Checkout
452-
uses: actions/checkout@v6
453-
- name: Setup git safe folders
454-
run: git config --global --add safe.directory '*'
455-
- name: Download npm package artifact
456-
uses: ./.github/actions/download-artifact
457-
with:
458-
name: react-native-package
459-
path: build
460-
- name: Download maven-local artifact
461-
uses: ./.github/actions/download-artifact
462-
with:
463-
name: maven-local
464-
path: /tmp/maven-local
465-
- name: Setup gradle
466-
uses: ./.github/actions/setup-gradle
467-
with:
468-
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
469-
- name: Run yarn install
470-
uses: ./.github/actions/yarn-install
471-
- name: Set Hermes prebuilt version
472-
shell: bash
473-
run: |
474-
node ./scripts/releases/use-hermes-prebuilt.js
475-
- name: Run yarn install again, with the correct hermes version
476-
uses: ./.github/actions/yarn-install
477-
- name: Prepare the Helloworld application
478-
shell: bash
479-
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)"
480-
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to New Architecture.
481-
shell: bash
482-
run: |
483-
cd private/helloworld/android
484-
args=()
485-
if [[ ${{ matrix.flavor }} == "Release" ]]; then
486-
args+=(--prod)
487-
fi
488-
yarn build android "${args[@]}" -P reactNativeArchitectures="$TARGET_ARCHITECTURE" -P react.internal.mavenLocalRepo="/tmp/maven-local"
489-
- name: Upload artifact
490-
uses: ./.github/actions/upload-artifact
491-
with:
492-
name: helloworld-apk-${{ matrix.flavor }}-NewArch-hermes
493-
path: ./private/helloworld/android/app/build/outputs/apk/
494-
compression-level: 0
495-
496-
test_ios_helloworld:
497-
runs-on: macos-15
498-
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
499-
if: ${{ needs.prebuild_react_native_core.result == 'success' }}
500-
strategy:
501-
matrix:
502-
flavor: [Debug, Release]
503-
env:
504-
PROJECT_NAME: iOSTemplateProject
505-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
506-
steps:
507-
- name: Checkout
508-
uses: actions/checkout@v6
509-
- uses: ./.github/actions/test-ios-helloworld
510-
with:
511-
flavor: ${{ matrix.flavor }}
512-
513-
# The CocoaPods opt-out stays supported, so CI keeps one CocoaPods build per test app.
514-
test_ios_helloworld_cocoapods:
515-
runs-on: macos-15
516-
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
517-
if: ${{ needs.prebuild_react_native_core.result == 'success' }}
518-
env:
519-
PROJECT_NAME: iOSTemplateProject
520-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
521-
steps:
522-
- name: Checkout
523-
uses: actions/checkout@v6
524-
- uses: ./.github/actions/test-ios-helloworld
525-
with:
526-
flavor: Debug
527-
dependency-manager: cocoapods
528-
529218
lint:
530219
runs-on: ubuntu-latest
531220
if: github.repository == 'react/react-native'

0 commit comments

Comments
 (0)