Skip to content

Commit 78ab456

Browse files
authored
ci: speed up Detox pipeline (#270)
1 parent b6f4767 commit 78ab456

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
run: |
5959
sudo xcode-select -s /Applications/Xcode_26.5.app/Contents/Developer
6060
xcodebuild -version
61-
sudo xcodebuild -runFirstLaunch
6261
xcrun simctl list runtimes
6362
6463
if ! xcrun simctl list runtimes | grep -q "iOS"; then
@@ -110,7 +109,6 @@ jobs:
110109
- name: Setup Xcode 26.5
111110
run: |
112111
sudo xcode-select -s /Applications/Xcode_26.5.app/Contents/Developer
113-
sudo xcodebuild -runFirstLaunch
114112
xcrun simctl list runtimes
115113
116114
if ! xcrun simctl list runtimes | grep -q "iOS"; then
@@ -209,6 +207,9 @@ jobs:
209207
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
210208

211209
- name: Build
210+
# emulator only needs x86_64; skip the other three ABIs' native builds
211+
env:
212+
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
212213
run: npx detox build --configuration android.emu.release
213214

214215
- name: Upload app apk
@@ -233,8 +234,9 @@ jobs:
233234
timeout-minutes: 30
234235
needs: android-build
235236
strategy:
237+
fail-fast: false
236238
matrix:
237-
api-level: [35]
239+
shard: [1, 2]
238240
steps:
239241
- name: Checkout
240242
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -296,24 +298,24 @@ jobs:
296298
chmod +x caddy
297299
./caddy run &
298300
299-
- name: Test
301+
- name: Test (shard ${{ matrix.shard }}/2)
300302
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0
301303
with:
302-
api-level: ${{ matrix.api-level }}
304+
api-level: 35
303305
disk-size: 1G
304306
heap-size: 1G
305307
force-avd-creation: false
306308
target: google_apis
307309
arch: x86_64
308310
disable-animations: true
309311
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
310-
script: npx detox test --configuration android.emu.release --cleanup --headless
312+
script: npx detox test --configuration android.emu.release --cleanup --headless -- --shard=${{ matrix.shard }}/2
311313

312314
- name: Upload artifacts on failure
313315
if: failure()
314316
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
315317
with:
316-
name: android-detox-artifacts-api-level-${{ matrix.api-level }}
318+
name: android-detox-artifacts-shard-${{ matrix.shard }}
317319
path: e2e/artifacts/
318320
retention-days: 7
319321

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Most folders are self-explanatory (`screens/`, `components/`, `utils/`, `i18n/`,
104104
- `lint``npm run lint`
105105
- `fastlane-validate` — store metadata sanity-checks
106106
- `ios-detox` — full iOS prebuild + Detox run on `depot-macos-26`
107-
- `android-build``android-test` — Android prebuild, then Detox on an emulator (API 34)
107+
- `android-build``android-test` — Android prebuild, then Detox on an emulator (API 35, 2 shards)
108108

109109
Both Detox jobs install evcc + Caddy in CI before running. If you add a test that needs more services, mirror that setup in both jobs.
110110

0 commit comments

Comments
 (0)