Skip to content

ci: speed up the android build (~2 min, no tests removed) - #86

Closed
vitofico wants to merge 1 commit into
mainfrom
ci/speed-up-android-build
Closed

ci: speed up the android build (~2 min, no tests removed)#86
vitofico wants to merge 1 commit into
mainfrom
ci/speed-up-android-build

Conversation

@vitofico

Copy link
Copy Markdown
Owner

What

The build job ran assembleDebug, test, and lint as three separate ./gradlew invocations (three configuration phases), and test/lint each built both the debug and release variants. Collapsed to a single debug-scoped invocation:

./gradlew assembleDebug testDebugUnitTest lintDebug --stacktrace

Why it's safe

  • Keeps every debug unit test, debug lint check, and the assembleDebug packaging check.
  • Drops only: release-variant unit tests + release lint (the release variant's compilation is still validated by the release job's assembleRelease on main; variant-specific unit tests are virtually never present), plus two redundant Gradle configuration phases.
  • No tests removed.

Impact (from a recent build's step timings)

Step Before After (est.)
Assemble debug APK 294s 294s (unchanged — real compilation)
Unit tests 146s (both variants) ~75s (debug only)
Lint 61s (both variants) ~30s (debug only)
Gradle config/daemon startup ×3 ×1

≈ 2 min off the ~9-min build. This PR's own build run demonstrates it.

The build job ran assembleDebug, test, and lint as three separate ./gradlew
invocations (three configuration phases), and test/lint each built BOTH the
debug and release variants. CI ships the debug APK and the release variant's
compilation is validated by the release job's assembleRelease, so the debug
variant is sufficient on the build job.

Collapse to a single debug-scoped invocation:
  ./gradlew assembleDebug testDebugUnitTest lintDebug

Keeps every debug unit test, debug lint check, and the APK packaging check;
drops only the redundant release-variant unit tests + release lint and two
extra configuration phases. ~2 min faster on a ~9 min build (unit tests
146s->~75s, lint 61s->~30s, two fewer daemon/config startups). No tests
removed.
@vitofico

Copy link
Copy Markdown
Owner Author

Closing — the ~2 min saving isn't worth the added workflow complexity and the release-variant test/lint coverage tradeoff. CI stays as-is.

@vitofico vitofico closed this Jul 10, 2026
@vitofico
vitofico deleted the ci/speed-up-android-build branch July 10, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant