name: Android CI

on:
  pull_request:
  push:
    branches:
      - main
      - master

jobs:
  verify:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: "17"

      - name: Set up Gradle
        uses: gradle/actions/setup-gradle@v4

      - name: Make wrapper executable
        run: chmod +x ./gradlew

      - name: Lint
        run: ./gradlew :app:lintDebug

      - name: Unit tests
        run: ./gradlew :app:testDebugUnitTest

      - name: Accessibility layout smoke test
        shell: pwsh
        run: ./scripts/test-accessibility-layout.ps1

      - name: Argus manifest smoke test
        shell: pwsh
        run: ./scripts/test-argus-manifest.ps1

      - name: Debug build
        run: ./gradlew :app:assembleDebug

      - name: Release build
        run: ./gradlew :app:assembleRelease
