name: Pull Request Build
# For pull requests: builds and test
on:
  push:
    branches:
      - '!master'
  pull_request:
    branches:
      - master
      - 23.x
      - 22.x
      - 21.x
      - 20.x
      - 19.x
permissions: # For test comment bot
  checks: write
  pull-requests: write
jobs:
  buildAndTest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: gradle/actions/wrapper-validation@v5
      - name: Set up JDK 21
        uses: actions/setup-java@v5
        with:
          java-version: '21'
          distribution: 'corretto'
      - name: build and test
        run: ./gradlew assemble && ./gradlew check --info --stacktrace
      - name: Publish Test Results
        uses: EnricoMi/publish-unit-test-result-action@v2.20.0
        if: always()
        with:
          files: '**/build/test-results/test/TEST-*.xml'

