Repository navigation
ci: cache node_modules, Pods and compiled objects, and overlap the slow iOS steps - #7
Merged
Merged
Conversation
Without its cache folder Yarn downloads every package again even when node_modules is there, so both are restored, on an exact key match only. yarn install --immutable still runs.
…le building Xcode's compilation cache is kept between runs, keyed on the Xcode build and the lockfiles. The runner is Apple silicon, so x86_64 is no longer built. Metro is asked for the app's bundle while Xcode builds.
andreialecu
force-pushed
the
ci/cache-builds
branch
from
November 25, 2026 10:50
ab37a33 to
75891f2
Compare
Keyed on the runner image and the ffmpeg version, with Homebrew's auto update, cleanup and dependents check off for the install.
ImageOS and ImageVersion are set on the runner, not in the workflow's env context, so read them in the shell.
|
🎉 This PR is included in version 0.1.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
The ios job took about 22 minutes with no caching at all. This caches what can be cached safely and builds less.
What changed
.yarn/cache,.yarn/install-state.gz,node_modulesandexample/node_modulesare restored, keyed on the OS, the architecture,.nvmrc,.yarnrc.yml, the Yarn release,.yarn/patches,yarn.lockand bothpackage.jsonfiles. Only an exact key match is restored. Both the Yarn cache folder andnode_modulesare needed: without the cache folder Yarn downloads every package again even whennode_modulesis there.yarn install --immutablestill runs.example/ios/Podsis restored, keyed on the Podfile,Podfile.lockandyarn.lock.pod installstill runs.COMPILATION_CACHE_ENABLE_CACHING=YES, withCOMPILATION_CACHE_CAS_PATHoutside the checkout) is kept between runs. The key has the Xcode build (the runner has Xcode 26.6, 17F113) and the lockfiles, and a partial match is restored, since entries are content addressed. The build step prints the number of hits and misses: 0 of 1045 cold, 1045 of 1045 warm. The cache is about 1 GB on disk and 380 MB compressed.ARCHS=arm64.HOMEBREW_NO_AUTO_UPDATE,HOMEBREW_NO_INSTALL_CLEANUPandHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK.Caches are saved right after the step that fills them, so a failing e2e run does not lose them.
Tried and dropped: booting the simulator in the background at the start of the job. On the runner it slowed the steps running beside it for minutes (setup-node went from about 5 s to 71-281 s), more than the boot takes, so the simulator is booted after the build as before.
When a cache misses or is stale
node_modules, Pods and Homebrew downloads are restored only on an exact key match, andyarn install --immutable,pod installandbrew installstill run against them.Timings (seconds)
Baseline: main run 45561584167. Cold: run 45598797065 (75891f2, empty caches, before the Homebrew change). Warm: run 45608262057 attempt 2 (9e32824, every cache restored).
The cold and warm runs landed on slow runners: the steps no cache touches (simulator, install and launch, e2e) took 2-4 times as long as in the baseline. Locally (Xcode 27.2), with a fresh derived data folder each time: 110 s without the cache, 136 s writing it, 51 s reading it.
e2e failures that are not from this change
Two e2e tests also fail on main (run 45585521876 on 2c808a3): "starts an AudioDecoder over after a flush (iOS)" and "handles the app going to the background". They fail here too. In some runs "exports WebGPU frames to an H.264 MP4 in memory" and "streams 210 frames at 1080x1920 to a file with a bounded backlog" time out (30 s eval timeout). They passed in other runs of this branch with the same build settings, and the first also timed out on PR #4 (run 45579218660).