GitHub Actions macOS Runner No Space Left
When a macOS CI job fails with `No space left on device`, the fix should be a repeatable runner policy, not a random cleanup command pasted into every workflow.
Common high-risk sources
- Xcode DerivedData, ModuleCache.noindex, and build intermediates
- Unused simulator runtimes, unavailable devices, and DeviceSupport folders
- Homebrew, npm, pnpm, CocoaPods, SwiftPM, Gradle, and toolchain caches
- Large test artifacts, screenshots, videos, archives, and logs
Safer CI cleanup order
- Print disk usage before cleanup so failures are diagnosable.
- Remove workflow-local build output and dependency caches with the owning tool first.
- Clean Xcode DerivedData and ModuleCache only after the job no longer needs those artifacts.
- Review simulator runtime deletion separately; deleting the wrong runtime can break later jobs.
- Print disk usage after cleanup and keep the numbers in the build log.
Starter commands
df -h
du -sh ~/Library/Developer/Xcode/DerivedData 2>/dev/null || true
du -sh ~/Library/Developer/CoreSimulator 2>/dev/null || true
du -sh ~/Library/Caches 2>/dev/null || true
xcrun simctl delete unavailable || true
Turn this into a team runner policy
The $99 Team Storage Pilot reviews one representative scan or CI log and returns a safe/review/do-not-touch cleanup policy for your macOS build environment.