Swift
Swift CI on GitHub Actions
Swift type-checking dominates build time and nothing is reused between runs.
14m → 4m
Build
14m → 70s
Incremental
Swift type-checking dominates build time and nothing is reused between runs.
Why it happens
SwiftPM's .build directory and Xcode's DerivedData are discarded, so every run type-checks the whole module graph.
What to change
- Persist .build for SwiftPM and DerivedData for Xcode projects
- Find slow expressions with -Xfrontend -warn-long-expression-type-checking=200
- Split modules so a change in one does not invalidate everything
- Use an M4 macOS runner — Swift compilation is strongly single-thread sensitive
Swift on runnerhut
yaml
jobs: test: runs-on: runnerhut-macos-15-m4 steps: - uses: actions/checkout@v4 - run: swift build --configuration release - run: swift test --parallelThe only runnerhut-specific line is `runs-on: runnerhut-macos-15-m4`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.