Repository navigation
ci: cut CI wall time and macOS minutes - #752
Merged
Merged
Conversation
The critical path was lint -> Build iOS App (28 min + queue) -> Detox (42 min + queue), about 1h45, with 5 macOS jobs per run against the account's 5 concurrent macOS jobs. iOS: - One `ios` job replaces build-ios, build-ios-new-arch, lint-podspec and test-detox-ios. It builds once (build-for-testing, arm64 only: the generic destination compiled x86_64 too) and runs XCTest (test-without-building, which no longer rebuilds) and Detox on that build; Detox used to rebuild the app for 22 min. The new-arch job built the same thing (RN >= 0.82 has no old architecture). - ccache (USE_CCACHE, read by react_native_post_install), cached per example lockfile. - The Detox simulator (iPhone 16 Pro on iOS 26.2, pinned: the references come from it, not from Xcode 16.4's 18.x SDK) boots at job start, the app is installed once and `detox test --reuse` stops the per-file reinstall (~40 s each); Metro bundles during the build. - Steps after the build run independently, so one failure doesn't hide the other results; the podspec lint runs last. Caches: Gradle, NuGet (~3 GB) and ccache are written from master only and restored on PRs. Per-PR copies were evicting master's from the 10 GB quota (10.3 GB used), so Windows saved 3 GB on every run (5 min) and nothing hit. Master runs are no longer cancelled by a newer push. Paths: a `changes` job (dorny/paths-filter) skips the platforms a pull request doesn't touch; pushes to master run everything. Android: one ABI (arm64-v8a) instead of the four in gradle.properties; the JUnit run keeps -PnewArchEnabled=false for the paper spec. Misc: npm ci everywhere, no second library build (`prepare` already builds it), the Playwright server wait polls instead of sleeping 30 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci.yml covers a debug build on every Android-touching PR; the release build (all ABIs) now runs on master, on demand and on PRs touching Android, the example or the library. It restores ci.yml's Gradle cache read-only and uses npm ci. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the first run of the merged job: - ccache stayed empty (0.0 GB) although the build went through RN's ccache-clang.sh: Xcode doesn't pass CCACHE_DIR to the compiler, so ccache wrote to ~/Library/Caches/ccache. Cache that directory, and trim it to 2 GB before saving (CCACHE_MAXSIZE isn't passed through either). - XCTest spent 29 min before its first test, cold-booting an iOS 18.x simulator next to the booted Detox one and Metro. It now runs after Detox, once Metro and the Detox simulator are shut down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every compile went through RN's ccache-clang.sh (464 of 464), yet ccache recorded no call and stored nothing in either directory tried, so it only added install and cache steps. Left for a separate investigation (likely how Xcode passes the environment to compiler tasks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prefetch asked for index.bundle?platform=ios&dev=true&minify=false, but RCTBundleURLProvider requests lazy=true plus Fusebox's excludeSource/sourcePaths and app=<bundle id>. Metro then built a second bundle on the first app launch with its 2 workers, and the home screen missed the 120 s wait (the first-launch flake on #744/#746/#748/#749 and this PR's runs). Match the query, and give that first wait 240 s within the 300 s hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Measured on a fully green run (#745, run 40719911613): the critical path was lint → Build iOS App (28 min + 28 min queued) → Detox (42 min), about 1h45, with 5 macOS jobs per run. GitHub Free allows 5 concurrent macOS jobs for the whole account, so a single PR saturated it and several PRs queued for up to 90 min. The repo's Actions cache was at 10.3 GB of its 10 GB quota, so caches were constantly evicted.
iOS: one job, one build
iosreplacesbuild-ios,build-ios-new-arch,lint-podspecandtest-detox-ios:build-ioscompiled it (19 min)build-for-testingshared by XCTest (test-without-building) and DetoxARCHS=arm64(the runners are Apple Silicon)build-ios-new-archcompiled the same thing (RN ≥ 0.82 is new-arch only)detox test --reuseThe Detox simulator is now pinned: iPhone 16 Pro on iOS 26.2 (
IOS_SIMULATOR_OS). That's the runtime Detox had been choosing on its own, the newest on the image, and the one the references were made on. It's newer than Xcode 16.4's SDK, so the build uses a generic arm64 destination and XCTest runs on the newest runtime that isn't newer than the SDK. If the image drops 26.2, the job says so clearly; build, XCTest and the podspec lint still report.Steps after the build don't depend on each other's success: a failing XCTest doesn't hide Detox, and the podspec lint runs last.
Caches
masteronly (actions/cache/save) and only restored on PRs. Per-PR copies were evictingmaster's: Windows got "Cache not found" and then spent 5 min re-saving 3 GB on every run.masterruns are no longer cancelled by a newer push (cancel-in-progressonly for PRs), so they finish writing the caches.Podfile.lock(alwaysmacOS-pods-) is removed.Paths
A
changesjob (dorny/paths-filter@v4) skips the platforms a PR doesn't touch (iOS, Android, Windows, web). For example, an Android-only PR no longer pays ~87 min of macOS. Pushes tomasterrun everything. No required checks are configured, so skipped jobs block nothing.Android
arm64-v8a) instead of the four ingradle.properties: Skia/Reanimated/worklets were compiled 4×. arm64 keeps the APK artifact installable on phones and Apple Silicon emulators.-PnewArchEnabled=false, so the paper spec (RN 0.80/0.81) stays compiled.build-apk.yml(release, all ABIs) runs onmaster, on demand, and on PRs touching Android, the example or the library.Misc
npm cieverywhere. The library is no longer built twice per job (preparealready builds it onnpm ci). The Playwright server wait polls instead ofsleep 30. The first Detox file'sbeforeAllgets 300 s (the first launch exceeded 180 s on #744/#746/#749).Trade-offs
--reuse, app data persists between test files (they used to start from a fresh install). The tests compare captures, not app state.ci.yml, so it runs every job. The gain will show on later PRs.Measured on this PR (run on e16c5a5)
Build iOS App28.5 min thenDetox41.9 min (≈70 min sequential, + queue)ccache dropped: all 464 compiles went through RN's
ccache-clang.sh, but ccache recorded no call and stored nothing (whether withCCACHE_DIRor its default directory). Likely an Xcode quirk in how it passes the environment to the compilers. To investigate separately.The first run of the merged job also exposed an XCTest wait of 29 min, cold-booting a second simulator alongside Detox's. XCTest now runs after Detox, once Metro and the simulator are shut down: 5.4 min.
Validation
actionlint+ shellcheck pass, except warnings already onmasterin the web summary step. Four/code-reviewpasses, findings fixed. Actual timings: in this PR's CI.🤖 Generated with Claude Code