How a fresh CI runner builds an iOS app twice as fast

Every GitHub-hosted macOS job starts on a new virtual machine and compiles the app from nothing, even when the last job compiled exactly the same code minutes ago. This is the story of how we got a fresh runner to reuse that work: why the usual fix doesn’t, what Xcode 26 made possible, what it still took on top, and what it bought on public apps, including where it bought little.

TL;DR

  • A restored DerivedData folder rebuilds anyway: checkouts give every file a new timestamp, and the folder is full of absolute paths.
  • Xcode 26 compilation caching keys each compile by its inputs, and can ask an outside service for results. That service, and what makes keys match across machines, is what we built.
  • On fresh GitHub-hosted runners, full Debug builds of IceCubes and Wikipedia iOS were 2.2× and 1.9× faster than the same builds without Warmbuild (medians of nine rounds), with every compile task served from the cache. Short builds gain less, and we explain why.
  • These are best-case builds with nothing changed. Runners of one type can differ by a factor of two, and linking, asset catalogs and package resolution are not cached. The workflow and every run are public.

A fresh runner starts empty

On a macos-26 runner, actions/checkout writes the repository onto a disk that has never seen it. There is no DerivedData, no module cache and no resolved Swift packages. So a pull request that changes one line compiles every target, every Swift package and every Clang module the SDK needs, then throws it all away when the VM goes. The next job does it again.

Most of that work has been done before. The default branch compiled the same sources an hour ago; the pull request changed a handful of files. What we wanted was for the runner to compile only those, and get the rest from somewhere.

Why caching DerivedData doesn’t help

The obvious first try is actions/cache on ~/Library/Developer/Xcode/DerivedData. The step reports a hit, the folder is there, and Xcode compiles everything anyway. We measured why on a small fixture app (details in the DerivedData guide):

  • Timestamps. Xcode’s incremental build redoes a task when an input’s modification time changes. Git stores no times, so a checkout makes every file new: 28 of 28 Swift compiles re-ran after we only touched the files.
  • Absolute paths. The folder is named after where the project is, and full of paths inside. Move the checkout or DerivedData and nothing matches.
  • Size. 196 MB for an 8-file app, most of it precompiled SDK modules, packed and unpacked on every job, under a 10 GB repository limit with branch-scoped, immutable entries.

Incremental builds answer “has this file changed since last time on this disk?”. A fresh runner has no last time. The question that works across machines is “have these exact inputs been compiled before, anywhere?”.

What Xcode 26 changed

Xcode 26 asks exactly that question. With COMPILATION_CACHE_ENABLE_CACHING=YES, each Swift and C-family compile task gets a key computed from its inputs, and its outputs are stored under that key in a content-addressed store. Timestamps and incremental state play no part, so a deleted DerivedData or a branch switched there and back still hits. Each cacheable task prints Cache hit or Cache miss in the build log.

On its own the store lives on the local disk, so a fresh runner still has nothing. But Xcode can also ask a cache service over gRPC on a Unix socket (COMPILATION_CACHE_ENABLE_PLUGIN, COMPILATION_CACHE_REMOTE_SERVICE_PATH), and the protocol is open in Apple’s fork of LLVM. Apple ships no shared service. The compilation caching guide covers the settings and what running such a service yourself takes.

What we built on top

Warmbuild is that service, started by one Action step before xcodebuild. The step exports XCODE_XCCONFIG_FILE, so the build command does not change. Getting hits on a fresh runner took more than answering the protocol.

A local server and a remote store

A small server on the runner listens on the socket. Xcode makes thousands of lookups per build, so the server answers what it can from its local tier and gathers the rest for 5 ms into one HTTPS batch to the cache, an edge cache in front of Cloudflare R2. Every entry is stored with the objects it names, so a hit is usually one read. Objects travel compressed with zstd, and the client checks each against its SHA-256; a mismatch is a miss. If the service is slow or down, Xcode compiles as it would without a cache, and the build passes.

Who writes

Anyone who can write can put a wrong object in everyone’s build, so by default only pushes to a repository’s default branch write. Pull requests and developers’ Macs only read; account admins can change the rules. Runners sign in with the job’s short-lived GitHub OIDC token, so there is no long-lived secret to store.

Path maps, so keys match across machines

Keys include paths unless they are mapped. The server writes prefix maps that send the checkout and DerivedData to fixed names, and Xcode’s own maps cover the SDK and toolchain. A pull request, another runner at another checkout path, and a developer’s Mac then compute the same keys the default branch wrote. One limit: Xcode 26’s Swift compiler crashes on remapped source paths, so there Swift files hit only at the checkout path the cache was filled from, which is fixed on hosted runners. Xcode 27 hits from any path.

Preload, because lookups wait on each other

A cold runner asks for its entries one after another, as Xcode reaches each task, and waits for every answer. Over the network those waits add up. So each build leaves a list of the entries it used, kept under its repository, and the next fresh runner with the same build name fetches the whole list, with the objects, while Xcode is still planning. A pull request reads its base branch’s list. This needs GitHub OIDC, because the list belongs to a repository; a matrix names each build with the build input.

Swift packages come back

A compilation cache serves compiles, not git clone. On a fresh runner, resolving remote Swift packages can take a large share of the job before the first compile starts. Since 1.13.0 the Action saves the SourcePackages folder Xcode resolved into (checkouts and binary artifacts), once per set of pins in the checkout’s Package.resolved files, and restores it before xcodebuild runs. When fetching packages still takes 20 s or more, the job summary says so.

What we measured

We wanted a number that answers “what does my CI job get?”, so the benchmark compares two fresh runners. In each round, one fresh runner builds the commit without Warmbuild, as the project does today. A second fills the cache. A third, another job at another checkout path, builds the commit from the remote cache alone, with its Swift packages restored by the Action. Every build starts once the runner has settled after boot. We ran nine rounds on 19 and 21 November 2026:

Fresh-runner builds with and without Warmbuild
App and commitBuilt forRoundsWithout WarmbuildFresh runner, remote cacheSpeedupCompile tasks hit
IceCubes 98098b9iOS Simulator9, median484 s (312–674)252 s (183–301)2.2× (1.1×–3.7×)100%
Wikipedia iOS 7fda4f2iOS Simulator9, median517 s (330–582)276 s (190–326)1.9× (1.1×–2.8×)100%
Snapzy 7c7f41cmacOS2: 3.7× and 3.4×432 s (405–459)123 s (109–137)3.5× (3.4×–3.7×)100%
Orchard 977e839macOS2: 3.1× and 2.7×820 s (742–898)279 s (271–286)2.9× (2.7×–3.1×)100%

Medians of nine rounds, with the slowest and fastest round in brackets. The speedup is the median of the rounds’ ratios. xcodebuild build, Debug, iOS Simulator, generic destination, code signing off; Xcode 27.2; GitHub-hosted macOS arm64 runners, standard size. Hits count the Cache hit and Cache miss lines, the cacheable Swift and Clang compile tasks.

IceCubes went from a median of 484 s to 252 s, and Wikipedia iOS from 517 s to 276 s: 2.2× and 1.9×. Every compile task hit (IceCubes about 2,600 hits per round with at most one miss; Wikipedia 1,938 of 1,938 in seven of nine rounds).

The bench also builds NetNewsWire, and it gains far less. Its setup script regenerates a Swift file of secrets with a random salt before every build, so the 58 compiles that depend on it can never hit, here or with any cache. The build is also short, and most of it is work the cache does not serve. Its runs are in the bench repository with the others.

Test runs and Release archive builds are being measured the same way. We will add them here when the runs are public, not before.

What the numbers don’t say

  • Runners vary. Hosted runners of one type can differ by a factor of two: in one round, the asset catalog step took 35 s on one runner and 80 s on the other. Single rounds scatter widely, which is why we report medians of nine. Read the medians, and expect your own runs to scatter too.
  • A check against ourselves. In three rounds the cached runner also built without Warmbuild afterwards, finding warm file-system caches. That order favours the build without Warmbuild, and the ratios came out lower; the bench README lists them.
  • Best case. Nothing changed between the build that filled the cache and the one that read it. A pull request that touches widely imported code recompiles everything that depends on it.
  • Not everything is compiling. Package resolution, asset catalogs, storyboards, script phases, dependency scanning and linking run every time. With every compile task a hit, the cached IceCubes and Wikipedia builds still took over four minutes; on Wikipedia, that uncached work is most of what is left. With caching on, Xcode’s Swift planning step also takes longer than without it.
  • Cold starts. A new Xcode version changes every key, so the first build on it fills the cache again and is slow. So does a project setting that turns caching off for a target (for example SWIFT_ENABLE_EXPLICIT_MODULES = NO); the job summary names such targets.

Try it

Sign in at warmbuild.dev, install the GitHub App on the account that owns the repository, and add one step:

.github/workflows/build.yml
permissions:  id-token: write   # the Action signs in with GitHub's OIDC token  contents: readjobs:  build:    runs-on: macos-26    steps:      - uses: actions/checkout@v5      - uses: warmbuild/action@v1      - run: xcodebuild build -scheme App -destination 'generic/platform=iOS Simulator'

The first push to the default branch fills the cache; the job summary shows hits, misses and where the minutes went. On a Mac, curl -fsSL https://warmbuild.dev/install.sh | sh sets up the same cache, read-only, for Xcode, xcodebuild and every git worktree. To check our numbers instead, the bench repository holds the workflow, the pinned commits and the run IDs, and anyone can run it again.

Set it up

Free during the beta. The GitHub Action · Security and write rules · Pricing

Sources

  1. Warmbuild, warmbuild/bench: the workflow, the pinned commits, the results of 19 and 21 November 2026 and their run IDs.
  2. Apple, Xcode 26 release notes, “Compilation caching”.
  3. swiftlang/llvm-project, llvm/lib/RemoteCachingService: the cache service protocol.
  4. GitHub Docs, GitHub-hosted runners: each job gets a new VM.
  5. The apps: IceCubes, Wikipedia iOS, NetNewsWire, at the commits in the table.
  6. DerivedData measurements: Warmbuild’s fixtures/ios app, Xcode 27.2, 15 November 2026 (the DerivedData guide).