name: Gradle Build

on: [push, pull_request]

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    name: Java ${{ matrix.java }} build
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: true
      matrix:
        java: [ 8 ]
        experimental: [false]
        include:
          - java: 17
            experimental: true
    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK ${{ matrix.java }}
        uses: actions/setup-java@v4
        with:
          java-version: ${{ matrix.java }}
          distribution: 'temurin'
          cache: gradle
      - name: Build with Gradle
        run: ./gradlew clean build javadoc
