name: Gradle Android Build & test

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
    paths:
      - 'extras/android/BtBench/**'
  workflow_dispatch:
    branches: [main]
    paths:
      - 'extras/android/BtBench/**'

permissions:
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 40

    steps:
      - name: Check out from Git
        uses: actions/checkout@v3

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

      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v3

      - name: Build with Gradle
        run: cd extras/android/BtBench && ./gradlew build
