Files
grimmory/.github/actions/gradle-task/action.yml
T

46 lines
1.4 KiB
YAML

name: Run Gradle Task
description: Set up the backend toolchain and run a gradle task
inputs:
app-version:
description: Application version string to include as an environment variable
required: true
working-directory:
description: Directory to change to for running gradle
default: backend/
gradle-extra-params:
description: Extra parameters for the gradle command
default: "--no-daemon --parallel --build-cache"
task:
description: Gradle Task to Run
required: true
task-extra-params:
description: Extra parameters for the gradle task
runs:
using: composite
steps:
- name: Set Up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
cache-dependency-path: |
**/*.gradle*
**/gradle.lockfile
**/settings.gradle*
**/gradle/wrapper/gradle-wrapper.properties
- name: Run Gradle Task
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
APP_VERSION: ${{ inputs.app-version }}
GRADLE_TASK: ${{ inputs.task }}
GRADLE_TASK_EXTRA_PARAMS: ${{ inputs.task-extra-params }}
GRADLE_EXTRA_PARAMS: ${{ inputs.gradle-extra-params }}
run:
./gradlew ${GRADLE_EXTRA_PARAMS} "${GRADLE_TASK}" ${GRADLE_TASK_EXTRA_PARAMS}