Skip to content

Commit b92c07d

Browse files
committed
ci: speed up the android build with one debug-scoped gradle invocation
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.
1 parent 9122893 commit b92c07d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/android-ci.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,13 @@ jobs:
160160
echo "::error::Rename guard found un-allowlisted OPDS_SYNC / opds-sync / opds_sync references."
161161
exit 1
162162
fi
163-
- name: Assemble debug APK
164-
run: ./gradlew assembleDebug --stacktrace
165-
- name: Unit tests
166-
run: ./gradlew test --stacktrace
167-
- name: Lint
168-
run: ./gradlew lint --stacktrace
163+
# One Gradle invocation (shared configuration phase + daemon) scoped to the
164+
# debug variant. `test`/`lint` build BOTH debug and release variants; CI
165+
# ships the debug APK and the release variant's compilation is validated by
166+
# the release job's assembleRelease, so the debug variant is sufficient
167+
# here. Cuts the build ~2 min without dropping any debug test or lint check.
168+
- name: Build, unit-test & lint (debug)
169+
run: ./gradlew assembleDebug testDebugUnitTest lintDebug --stacktrace
169170
- name: Upload debug APK
170171
if: github.ref == 'refs/heads/main'
171172
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5

0 commit comments

Comments
 (0)