Skip to content

Xcode Build Cache

Avrea caches Xcode compilation in colocated cache so that rebuilds only recompile what actually changed. This works across jobs, branches, and workflow runs, and is fast - warm builds reuse compiled modules instead of recompiling from scratch.

Available on macOS runners only.

The cache is pre-configured before your workflow steps run, so every xcodebuild invocation uses it with no workflow changes:

workflow.yml
jobs:
build:
runs-on: avrea-macos-latest
steps:
- uses: actions/checkout@v6
- run: |
xcodebuild \
-scheme MyApp \
-destination 'platform=macOS' \
build

The cache is controlled by the Xcode Compilation Cache setting (organization and repository scope), which is on by default. Turn it off there to disable it.

  • Xcode 26 or later: compilation caching relies on Xcode 26's caching support.
  • macOS runner: the cache has no effect on non-macOS runners.

The compilation cache covers your project's own sources. It does not cache the downloaded and compiled Swift Package dependencies of an app target. Cache those with the standard GitHub Actions cache over the SwiftPM global cache directory:

  • macOS: ~/Library/Caches/org.swift.swiftpm/
  • Linux: ~/.cache/org.swift.swiftpm/
workflow.yml
- uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/.cache/org.swift.swiftpm
key: swiftpm-${{ runner.os }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
swiftpm-${{ runner.os }}-