2024-01-26 17:43:38 +00:00
> [!IMPORTANT]
> As of `v3` this action has been superceded by `gradle/actions/setup-gradle`.
> Any workflow that uses `gradle/gradle-build-action@v3` will transparently delegate to `gradle/actions/setup-gradle@v3`.
>
> Users are encouraged to update their workflows, replacing:
> ```
> uses: gradle/gradle-build-action@v3
> ```
>
> with
> ```
> uses: gradle/actions/setup-gradle@v3
> ```
>
2024-01-31 13:56:26 +00:00
> See the [setup-gradle documentation](https://github.com/gradle/actions/tree/main/setup-gradle) for up-to-date documentation for `gradle/actions/setup-gradle`.
2024-01-26 17:43:38 +00:00
2024-08-07 22:48:29 +00:00
# Setup Gradle for use in GitHub Actions workflows
2019-09-20 21:06:59 +00:00
2024-08-07 22:48:29 +00:00
This GitHub Action can be used to configure Gradle on any platform supported by GitHub Actions.
2019-09-20 21:06:59 +00:00
2024-02-13 20:42:19 +00:00
## Example usage
2019-09-23 10:56:08 +00:00
```yaml
2024-02-13 20:42:19 +00:00
name: Build
2024-01-01 20:48:08 +00:00
2024-02-13 20:42:19 +00:00
on: [ push ]
2023-08-20 22:27:48 +00:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-02-13 20:42:19 +00:00
- name: Checkout sources
uses: actions/checkout@v4
2023-08-20 22:27:48 +00:00
- name: Setup Gradle
2024-08-07 22:48:29 +00:00
uses: gradle/actions/setup-gradle@v3
2024-02-13 20:42:19 +00:00
- name: Build with Gradle
2023-08-20 22:27:48 +00:00
run: ./gradlew build
```
2024-02-13 20:42:19 +00:00
See the [full setup-gradle documentation ](https://github.com/gradle/actions/tree/main/setup-gradle ) for more advanced usage scenarios.