Skip to content

Gradle

Gradle CI on GitHub Actions

The configuration phase runs for 40 seconds before anything compiles.

42s → 1.5s
Configuration phase
12m → 3m
Build

The configuration phase runs for 40 seconds before anything compiles.

Why it happens

Without the configuration cache Gradle re-evaluates every build script on every invocation.

What to change

  1. Enable --configuration-cache and --build-cache
  2. Cache ~/.gradle/caches keyed on the build scripts and lockfiles
  3. Use the Gradle remote build cache so CI and developers share outputs
  4. Avoid dynamic versions — they force dependency re-resolution every run

Gradle on runnerhut

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