When starting a new project, I always find getting the tools up and running quickly is a pain, so I wanted something for java / android which already had everything setup and working.
This is a WiP inspired by a similar repo for Kotlin / Android: https://github.com/compscidr/hello-kotlin-android
In order to get instrumented test coverage, I'm using an android emulator container which is linked to a self-hosted runner container: https://jasonernst.com/posts/2021/08/08/Android-Emulator-with-Github-Actions-on-Linux.
The other option is to use macos github hosted runners (emulator needs gpu accel to run in a reasonable time) but I'm cheap and the macos instances are expensive and use all my actions credits too quickly.
This aims to be a starter repo with all of the following tooling setup:
- Github actions
- Checkstyle
- Junit5 (unit + integration tests)
- Jacoco
- Codecov
There are three different reports produced:
- one for debug unit tests (located in
app/build/reports/jacoco/jacocoTestReportDebug
) - one for release unit tests (located in
app/build/reports/jacoco/jacocoTestReportRelease
) - one for connected (on device / emulator tests) (located in
app/build/reports/coverage/androidTest/debug
)
In order to produce them all, just run:
./gradlew connectedCheck && ./gradlew jacocoTestReport