name: Run Gradle
description: Sets up Gradle JDKs and runs Gradle
inputs:
  arguments:
    required: true
    description: Gradle arguments
    default: build
runs:
  using: "composite"
  steps:
    - uses: actions/setup-java@v3
      id: setup-gradle-jdk
      with:
        distribution: temurin
        java-version: 17
    - uses: gradle/gradle-build-action@v2
      env:
        JAVA_HOME: ${{ steps.setup-gradle-jdk.outputs.path }}
      with:
        arguments: |
          -Porg.gradle.java.installations.auto-download=false
          -PenablePredictiveTestSelection=${{ github.event_name == 'pull_request' }}
          "-Dscan.value.GitHub job=${{ github.job }}"
          javaToolchains
          ${{ inputs.arguments }}
