Skip to content

Android

Android CI on GitHub Actions

Gradle re-resolves dependencies and the emulator has no hardware acceleration.

40m → 9m
Emulator tests
11m → 3m
Gradle build

Gradle re-resolves dependencies and the emulator has no hardware acceleration.

Why it happens

~/.gradle is cold and GitHub-hosted Linux runners do not expose /dev/kvm on standard tiers.

What to change

  1. Cache ~/.gradle/caches and ~/.android/avd
  2. Run on a runner that exposes KVM so the emulator is hardware accelerated
  3. Enable the Gradle configuration cache and build cache
  4. Split unit tests and instrumentation tests into separate jobs

Android on runnerhut

yaml
jobs:
test:
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew testDebugUnitTest --build-cache
- uses: reactivecircus/android-emulator-runner@v2
with: { api-level: 34, script: ./gradlew connectedCheck }
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.