Files
gradle-build-tools-actions/setup-gradle/README.md
T

35 lines
1.1 KiB
Markdown
Raw Normal View History

## The `setup-gradle` action
2019-09-20 23:06:59 +02:00
The `setup-gradle` action can be used to configure Gradle for optimal execution on any platform supported by GitHub Actions.
2019-09-20 23:06:59 +02:00
This replaces the previous `gradle/gradle-build-action`, which now delegates to this implementation.
2023-08-17 15:13:47 -06:00
The recommended way to execute any Gradle build is with the help of the [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html), and the examples assume that the Gradle Wrapper has been configured for the project. See [this example](../docs/setup-gradle.md#build-with-a-specific-gradle-version) if your project doesn't use the Gradle Wrapper.
### Example usage
2021-12-30 18:12:37 -07:00
2019-09-21 16:01:53 +02:00
```yaml
name: Build
2024-04-18 09:39:15 -06:00
on:
push:
2019-09-21 16:01:53 +02:00
jobs:
build:
2019-09-21 16:01:53 +02:00
runs-on: ubuntu-latest
steps:
- name: Checkout sources
2023-09-30 18:24:45 -06:00
uses: actions/checkout@v4
2024-04-05 14:45:05 -06:00
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
2022-04-04 15:12:03 -06:00
- name: Setup Gradle
2024-01-29 09:52:29 -07:00
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew build
```
See the [full action documentation](../docs/setup-gradle.md) for more advanced usage scenarios.