Skip to content

Set up your GitHub Actions workflow with a specific version of Groovy

License

Notifications You must be signed in to change notification settings

WtfJoke/setup-groovy

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

CI Security Rating Maintainability Rating Bugs Code Smells Technical Debt Lines of Code codecov

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.

🔧 Usage

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

📊 Supported version syntax

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