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
- Cache ~/.gradle/caches and ~/.android/avd
- Run on a runner that exposes KVM so the emulator is hardware accelerated
- Enable the Gradle configuration cache and build cache
- 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 }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.
Related
React NativeEvery build recompiles native iOS and Android dependencies from source.iOSXcode builds from scratch and code signing is fragile in CI.FlutterThe Flutter SDK and pub cache download on every run, for every platform.FastlaneFastlane lanes spend most of their time on bundle install and signing setup.