2024-01-26 10:43:38 -07: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 14:56:26 +01: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 10:43:38 -07:00
2021-08-07 15:17:27 -07:00
# Execute Gradle builds in GitHub Actions workflows
2019-09-20 23:06:59 +02:00
2021-12-08 13:33:39 -07:00
This GitHub Action can be used to configure Gradle and optionally execute a Gradle build on any platform supported by GitHub Actions.
2019-09-20 23:06:59 +02:00
2024-02-13 13:42:19 -07:00
## Example usage
2019-09-23 12:56:08 +02:00
```yaml
2024-02-13 13:42:19 -07:00
name: Build
2024-01-01 13:48:08 -07:00
2024-02-13 13:42:19 -07:00
on: [ push ]
2023-08-20 16:27:48 -06:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-02-13 13:42:19 -07:00
- name: Checkout sources
uses: actions/checkout@v4
2023-08-20 16:27:48 -06:00
- name: Setup Gradle
2024-01-31 04:28:34 -07:00
uses: gradle/gradle-build-action@v3
2024-02-13 13:42:19 -07:00
- name: Build with Gradle
2023-08-20 16:27:48 -06:00
run: ./gradlew build
```
2024-02-13 13:42:19 -07:00
As of `v3` , the `gradle/gradle-build-action` action delegates to `gradle/actions/setup-gradle` with the same version.
Configuration and usage of these actions is identical for releases with the same version number.
2023-09-21 10:47:51 -06:00
2024-02-13 13:42:19 -07:00
See the [full setup-gradle documentation ](https://github.com/gradle/actions/tree/main/setup-gradle ) for more advanced usage scenarios.