gradle / gradle-build-action

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

Provide dedicated action for dependency graph submission #1035

Closed bigdaz closed 8 months ago

ben-manes commented 8 months ago

Please include buildscript (plugin) dependencies or allow as a setting. (Mentioning since I currently use an older action with that option)

bigdaz commented 8 months ago

@ben-manes The new action will use the same mechanism as gradle-build-action, which should capture all dependencies including plugin dependencies. Projects and configurations can be excluded, but I'd like to make this more configurable and have better defaults.

ben-manes commented 8 months ago

Wonderful, thanks

bigdaz commented 8 months ago

A first version of gradle/actions/dependency-submission has just been released: https://github.com/gradle/actions/releases/tag/v3.0.0-beta.6

ben-manes commented 8 months ago

hmm.. I tried the new action and get an error

Cannot locate tasks that match ':ForceDependencyResolutionPlugin_resolveAllDependencies' as task 'ForceDependencyResolutionPlugin_resolveAllDependencies' not found in root project 'caffeine'.

I assumed this was from an init script but isn't being applied to the root build.

ben-manes commented 8 months ago

oh! it is because I had setup-gradle run before dependency-submission for the old action. That combination fails in your new set up as the init script must be already configured. Once I removed it then it worked. Seems like an easy thing to warn on.

bigdaz commented 8 months ago

Thanks for the feedback. I haven't really announced the new dependency-submission action, and I'd say it's not quite ready for the prime-time. The idea is that it should be used in a separate, minimal workflow, ideally with very little user customisation.

But you're right: we should be able to warn if dependency-submission is used after a previous step that uses setup-gradle.

bigdaz commented 8 months ago

Note that you can continue to use setup-gradle with the dependency-graph option. In that way, setup-gradle should be a drop-in replacement for gradle-build-action.

Can I ask why you're running the help task as part of the "Setup Gradle" step?

ben-manes commented 8 months ago

yep! no worries that I'm a super early adopter and have zero expectations. just providing feedback as low risk to run on my project and not a priority for you. The old submission action was deprecated and archived, so I thought switching to was a nice friday activity.

ben-manes commented 8 months ago

oh! you would need to look at the v3 branch. Here is my PR of the process working.

The help was in order to force gradle to be downloaded and set up. Since Caffeine runs so many jobs, the CI would get rate limited with network timeouts. The backoff-and-retry was to minimize that for gradle and jdk set ups.

In the v3 branch, I removed the usage of arguments and that help check since isn't needed. I'm not sure if it ever was.