The wtfjoke/setup-groovy
action is a JavaScript action that sets up Apache Groovy in your GitHub Actions workflow. by:
- Downloading a requested version of Groovy and adding it to the
PATH
.
See action.yml
This action can be run on ubuntu-latest
, windows-latest
, and macos-latest
GitHub Actions runners.
steps:
- uses: wtfjoke/setup-groovy@v2
with:
groovy-version: '4.x'
- run: groovy --version
If there is a specific version of Groovy that you need and you don't want to worry about any potential breaking changes due to patch updates (going from 4.0.8
to 4.0.9
for example), you should specify the exact major, minor, and patch version (such as 4.0.9
):
steps:
- uses: actions/checkout@v3
- uses: wtfjoke/setup-groovy@v2
with:
groovy-version: '4.0.9'
- run: groovy HelloWorld.groovy
You can specify only a major and minor version if you are okay with the most recent patch version being used:
steps:
- uses: actions/checkout@v3
- uses: wtfjoke/setup-groovy@v2
with:
groovy-version: '4.0'
- run: groovy HelloWorld.groovy
You can also use ranges that are specified in semver, for example a hyphen-range:
steps:
- uses: actions/checkout@v3
- uses: wtfjoke/setup-groovy@v2
with:
groovy-version: '>=3.x <4.0.0'
- run: groovy HelloWorld.groovy