Skip to content

Commit ce29f88

Browse files
authored
Improve CI time (#390)
* Speed up CI by splitting RN jobs * Drop clean from android tests
1 parent 2a3346d commit ce29f88

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

.github/workflows/android-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
cache: 'gradle'
2929

3030
- name: Run Tests
31-
run: ./gradlew clean test --console=plain
31+
run: ./gradlew test --console=plain
3232

3333
build:
3434
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
outputs:
3131
android: ${{ steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.android == 'true' }}
3232
swift: ${{ steps.platform.outputs.swift == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.swift == 'true' }}
33-
reactNative: ${{ steps.platform.outputs.reactNative == 'true' || steps.platform.outputs.swift == 'true' || steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.reactNative == 'true' }}
33+
reactNative: ${{ steps.platform.outputs.reactNative == 'true' || steps.platform.outputs.swift == 'true' || steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.reactNativeCommon == 'true' || steps.infra.outputs.reactNativeIos == 'true' || steps.infra.outputs.reactNativeAndroid == 'true' }}
34+
reactNativeIos: ${{ steps.platform.outputs.reactNative == 'true' || steps.platform.outputs.swift == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.reactNativeCommon == 'true' || steps.infra.outputs.reactNativeIos == 'true' }}
35+
reactNativeAndroid: ${{ steps.platform.outputs.reactNative == 'true' || steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.reactNativeCommon == 'true' || steps.infra.outputs.reactNativeAndroid == 'true' }}
3436
web: ${{ steps.platform.outputs.web == 'true' || steps.infra.outputs.web == 'true' }}
3537
steps:
3638
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
@@ -64,14 +66,10 @@ jobs:
6466
- '.github/workflows/breaking-changes.yml'
6567
- '.github/filters/**'
6668
- '.github/workflows/ci.yml'
67-
reactNative:
68-
- 'Package.swift'
69-
- 'Package.resolved'
69+
# Common React Native infra: JS-level jobs (jest, lint, packed
70+
# files) and shared config that should trigger all RN jobs.
71+
reactNativeCommon:
7072
- '.github/workflows/rn-test.yml'
71-
- '.github/workflows/rn-test-android.yml'
72-
- '.github/workflows/rn-test-ios.yml'
73-
- '.github/workflows/rn-build-android.yml'
74-
- '.github/workflows/rn-build-ios.yml'
7573
- '.github/workflows/rn-check-packed-files.yml'
7674
- '.github/workflows/rn-lint.yml'
7775
- '.github/workflows/rn-publish.yml'
@@ -82,6 +80,16 @@ jobs:
8280
- '.github/filters/**'
8381
- '.github/workflows/breaking-changes.yml'
8482
- '.github/workflows/ci.yml'
83+
# iOS-only RN infra: gates the macOS build/test jobs.
84+
reactNativeIos:
85+
- 'Package.swift'
86+
- 'Package.resolved'
87+
- '.github/workflows/rn-test-ios.yml'
88+
- '.github/workflows/rn-build-ios.yml'
89+
# Android-only RN infra: gates the gradle build/test jobs.
90+
reactNativeAndroid:
91+
- '.github/workflows/rn-test-android.yml'
92+
- '.github/workflows/rn-build-android.yml'
8593
web:
8694
- '.github/workflows/web.yml'
8795
- '.github/actions/setup/**'
@@ -133,25 +141,25 @@ jobs:
133141
rn-test-android:
134142
name: React Native
135143
needs: changes
136-
if: needs.changes.outputs.reactNative == 'true'
144+
if: needs.changes.outputs.reactNativeAndroid == 'true'
137145
uses: ./.github/workflows/rn-test-android.yml
138146

139147
rn-test-ios:
140148
name: React Native
141149
needs: changes
142-
if: needs.changes.outputs.reactNative == 'true'
150+
if: needs.changes.outputs.reactNativeIos == 'true'
143151
uses: ./.github/workflows/rn-test-ios.yml
144152

145153
rn-build-android:
146154
name: React Native
147155
needs: changes
148-
if: needs.changes.outputs.reactNative == 'true'
156+
if: needs.changes.outputs.reactNativeAndroid == 'true'
149157
uses: ./.github/workflows/rn-build-android.yml
150158

151159
rn-build-ios:
152160
name: React Native
153161
needs: changes
154-
if: needs.changes.outputs.reactNative == 'true'
162+
if: needs.changes.outputs.reactNativeIos == 'true'
155163
uses: ./.github/workflows/rn-build-ios.yml
156164

157165
rn-check-packed-files:

0 commit comments

Comments
 (0)