Files
Android-Architecture-Showcase/.github/workflows/ci.yml
Adrian Kuta 7a7ab45a66 test infra: JUnit5 unit tests on Android modules + Compose UI test wiring
Add an architecture.android.unit.test convention plugin that runs local unit
tests on the JUnit5 platform via useJUnitPlatform() (AndroidUnitTest extends
Gradle's Test) + the unit-test bundle. Deliberately NOT using the
de.mannodermaus plugin (targets AGP 8.x; we're on AGP 9). Add
junit-platform-launcher (Gradle 9 dropped the bundled launcher); set the
instrumentation runner; add a compose-ui-test bundle pinning espresso/runner to
current versions (transitive espresso 3.5.0 calls the removed
InputManager.getInstance() on API 34+). CI now runs ./gradlew test and compiles
the instrumented tests. Drop unused testing catalog entries.
2026-06-10 15:00:37 +02:00

50 lines
1.3 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Unit tests (JUnit 5)
run: ./gradlew test --no-daemon --stacktrace
- name: Assemble (debug) + compile instrumented tests
# assembleDebugAndroidTest compiles the Compose UI test; it runs on a device via
# connectedDebugAndroidTest (locally / on an emulator runner), not in this build job.
run: ./gradlew assembleDebug assembleDebugAndroidTest --no-daemon --stacktrace
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: '**/build/reports/tests/'
if-no-files-found: ignore