Skip to content

Scala

Scala CI on GitHub Actions

sbt spends longer starting up and resolving than compiling.

90s → 8s
sbt startup
11m → 3m
Compile

sbt spends longer starting up and resolving than compiling.

Why it happens

sbt boots a JVM, resolves Coursier dependencies and loads the build definition before a single file compiles.

What to change

  1. Cache ~/.cache/coursier, ~/.sbt and the target/ directories
  2. Use sbt --client or run all tasks in a single sbt invocation
  3. Enable the Zinc incremental compiler cache across runs
  4. Give the JVM 8 GB or more — Scala compilation is memory-hungry

Scala on runnerhut

yaml
jobs:
test:
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- run: sbt "compile; test"
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.