Kotlin Multiplatform
Kotlin Multiplatform CI on GitHub Actions
Each target compiles serially and the Kotlin/Native cache is discarded.
19m → 5m
Native compile
Each target compiles serially and the Kotlin/Native cache is discarded.
Why it happens
~/.konan holds the Kotlin/Native toolchain and compiled artefacts and is cold on every run.
What to change
- Cache ~/.konan and ~/.gradle/caches keyed on the Kotlin version
- Compile JVM, JS and native targets as parallel matrix legs
- Build Apple targets on a macOS runner and everything else on Linux
Kotlin Multiplatform on runnerhut
yaml
jobs: build: strategy: matrix: os: [runnerhut-8vcpu-ubuntu-2404, runnerhut-macos-15-m4] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - run: ./gradlew build --build-cacheThe only runnerhut-specific line is `runs-on: runnerhut-8vcpu-ubuntu-2404`. 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.
Related
React NativeEvery build recompiles native iOS and Android dependencies from source.iOSXcode builds from scratch and code signing is fragile in CI.AndroidGradle re-resolves dependencies and the emulator has no hardware acceleration.FlutterThe Flutter SDK and pub cache download on every run, for every platform.