Skip to content

Kotlin

Kotlin CI on GitHub Actions

Kotlin compilation is slower than Java and the daemon restarts every run.

7m → 2m
Compile
40s → 2s
Config phase

Kotlin compilation is slower than Java and the daemon restarts every run.

Why it happens

kotlinc has a heavier front end, and without the configuration cache Gradle re-evaluates the whole build graph each time.

What to change

  1. Turn on the Gradle configuration cache and the Kotlin incremental compiler
  2. Cache ~/.gradle/caches and the build/ directories of stable modules
  3. Use kotlin.incremental=true and keep the daemon warm inside the job
  4. Split multiplatform targets into a matrix so they compile in parallel

Kotlin on runnerhut

yaml
jobs:
build:
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew assemble --build-cache --configuration-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.