Skip to content

Clojure

Clojure CI on GitHub Actions

JVM startup and dependency resolution cost more than the tests.

80s → 3s
Dependency resolve

JVM startup and dependency resolution cost more than the tests.

Why it happens

~/.m2 and ~/.gitlibs are cold, and each clj invocation pays full JVM startup.

What to change

  1. Cache ~/.m2/repository and ~/.gitlibs keyed on deps.edn
  2. Run all test namespaces in one JVM rather than one per namespace
  3. Precompile with clj -T:build to avoid repeated AOT work

Clojure on runnerhut

yaml
jobs:
test:
runs-on: runnerhut-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: DeLaGuardo/setup-clojure@v13
with: { cli: latest }
- run: clojure -M:test
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-4vcpu-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.