gradle / gradle-build-action

Execute your Gradle build and trigger dependency submission
https://github.com/marketplace/actions/gradle-build-action
MIT License
679 stars 97 forks source link

Doc clarification: When does Setup Gradle step not apply to subsequent executions? #867

Closed 3flex closed 1 year ago

3flex commented 1 year ago

Docs say:

Most of the functionality of the gradle-build-action is applied via Gradle init-scripts, and so will apply to all subsequent Gradle executions on the runner, no matter how Gradle is invoked.

Emphasis on "most" is mine - when does this not apply?

I was about to switch to that method (a setup step, then using run action from then on) but wasn't sure if there might be a gotcha there to be aware of.

bigdaz commented 1 year ago

Yes, I can see how that could be confusing. In reality, all of the features apply regardless of how Gradle is invoked (via the gradle-build-action or via a run action).

So there's no practical difference between the 2 patterns, but we recommend specifying a gradle-build-action step to setup Gradle and then a simple run step to execute Gradle. This makes the use of the gradle-build-action less intrusive on your workflow.

I'll update the docs for clarity. Thanks for reporting.

bigdaz commented 1 year ago

I guess the "most" in that sentence applied to the use of init-scripts. Some functions (like setting the default version of Gradle) work by configuring environment variables that apply to all Steps in the Job.

3flex commented 1 year ago

Thank you!