ci(mobile): cache deps + parallelize OTA + decouple lint to speed up OTA ~3x#14326
Merged
Conversation
|
…off OTA runtime OTA publish on merge-to-main currently takes ~21min. Three changes cut the critical path to ~6-7min on the hot path (JS-only merges, no version bump): 1. Restore the node_modules cache in mobile-ota-release(-production). The previous job ran `npm ci` cold every time (~5m37s); with the same cache block as the install job, the install drops to ~30s. 2. Matrix mobile-ota-release(-production) over [ios, android] so the two code-push releases run in parallel jobs instead of sequentially in one step (~10min → ~5min on the publish step). 3. Split mobile-init into mobile-install (install + cache only, ~1min) and mobile-verify (lint + typecheck, ~3.5min). All downstream jobs depend on mobile-install; mobile-verify runs in parallel and still fails the workflow if lint/types break, but no longer gates publish. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
423de3d to
7ed84c6
Compare
4 tasks
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.
Summary
Mobile OTA publish on merge-to-main takes ~21 min today. This PR drops it to ~6-7 min on the critical path with three changes to
.github/workflows/mobile.yml.1. Cache
node_modulesinmobile-ota-release(-production)— ~5 min savedThe OTA job ran
npm cicold every time (5m37s on run 25822024076). The install job 7 minutes earlier already has the rightactions/cache@v4block — the OTA job was just missing it. Now restored from the same key; install drops to ~30s.2. Matrix the OTA job over
[ios, android]— ~5 min savedThe publish step ran iOS and Android
code-push releasecalls sequentially in one step (10m9s). Now matrixed so the two platforms run as parallel matrix-runs of the same job. Each does its own Metro bundle + S3 upload.fail-fast: falseso one platform's failure doesn't kill the other's upload.3. Split
mobile-initintomobile-install+mobile-verify— ~3 min saved on critical pathmobile-initpreviously did install (~30s) + lint/typecheck (~3m28s) in one job, and every downstream job (OTA + 4 build jobs) had to wait on the full 4m27s before starting.mobile-install— checkout + cache + install only (~1 min).mobile-verify— lint + typecheck, depends onmobile-install. Runs in parallel with all downstream jobs. Still fails the workflow if lint/types break, but no longer gates publish.All
needs: [mobile-init, …]references updated tomobile-install.New dependency graph
Critical path on the hot path (JS-only merge, no version bump): ~1m install + ~10s version-check + ~5m OTA = ~6-7 min wall-clock, vs. ~21 min before.
Test plan
python3 -c \"import yaml; yaml.safe_load(open('.github/workflows/mobile.yml'))\")mainwith no version bump:mobile-installruns first and populates the node_modules cachemobile-verifyruns in parallel withmobile-ota-release(no longer gates it)mobile-ota-releaseappears as two parallel matrix runs (ios,android)mobile-ota/bundles/{ios,android}/rc/…mobile-install+mobile-version-check, same shape as before)workflow_dispatchwithota_channel=productionstill triggers the production OTA job (now matrixed)main, the workflow as a whole still fails (viamobile-verify) even though the OTA publish completes🤖 Generated with Claude Code