name: gradle-ci

on: [push, pull_request, workflow_dispatch]

jobs:
  build-gradle-project:
    runs-on: ubuntu-latest

    env:
      GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m"
      SONAR_JDK: "11"

    strategy:
      matrix:
        java-version: [ 17 ]

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Set up JDK ${{ matrix.java-version }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java-version }}

      - name: Grant execute permission for gradlew
        run: chmod +x gradlew

      - name: Test with Gradle
        run: ./gradlew clean jar app:test
