Skip to content

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

  1. Cache ~/.konan and ~/.gradle/caches keyed on the Kotlin version
  2. Compile JVM, JS and native targets as parallel matrix legs
  3. 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-cache
A working starting point

The 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.