-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common reusable actions #10048
Common reusable actions #10048
Conversation
The setup-go action fails when there is nothing cached. So if we setup Go all the time (for simplicity's sake), it will fail if there are steps where nothing was cached, and they run before something was cached for this cache key. I guess we do have to make it optional, then. |
One interesting thing to note, is that the setup/build actions could probably be merged under the current conditions. We almost never really do one without the other (only on deploy do we do build/install differently), and there is a clear dependency between the build and setup (plus, if you disable Java/Go in one, you have to disable it in the other). But I'm not sure if that's a good idea long term, and I like the flexibility of having multiple small actions (plus they're easier to understand individually). If you combine them both, then you as you need more flexibility (different java versions, different Go versions, etc.), then you start having an action with tons of inputs that just delegates to other actions. It seems rather cumbersome, to some extent. I also don't want to go too much into having many tiny actions, I think that'll just create more confusion than anything. Also note that we could cut down on a bunch of flexibility I added here. For example, we never change the Java/Go versions, or the Maven version, so we could remove those inputs. This would make merging both actions a bit simpler, since you only have one param per language (enable go, enable java) 🤷 |
38c3f8d
to
ff79bc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @npepinpe, this looks great 😍
I have one blocking question regarding javadocs that we should resolve before merging though.
ff79bc2
to
e5d9f43
Compare
bors merge |
Build succeeded: |
Description
This PR aggregates the steps to set up the Zeebe environment for packaging, as well as packaging itself, into two reusable actions. By doing this, it removes the duplicate code in the
build-docker
action, and instead relies on the caller having set up and packaged Zeebe beforehand (much like we rely on the checkout step being invoked before).setup-zeebe
will prepare the environment to build the complete Zeebe distribution. The benefits here is that we centralize once the tech stack, how it's installed, and the versions we require, instead of spreading this everywhere. I've made it configurable so some parts can be ignored, primarily because of thesetup-go
action. If you use that, but do not do anything with Go, it will fail in its post-run when trying to clean a non-existent cache 🤷 The action requires the code to have been checked out beforehand.build-zeebe
will build the Go client (optional) and the Java distribution (optional). By default, it builds everything. It also requires the environment to be set up beforehand, and the code checked out. It uses theclients/go/cmd/zbctl/build.sh
script to build the Go client, and willinstall
the mvn modules, skipping checks and using-T1C
to parallelize by default. You can customize the installation via a free-form field letting you set up additional properties to pass to the build. The benefits here is again centralization of the common set up, while allowing enough customization for the various steps.I decided to split both set up and packaging because there are some places where we package the application differently, notably when deploying/releasing. As this will most likely be used in the future for releases, it made sense to me. So the packaging is really more of a "package for non-release cases". It could be changed to allow us to modify the command for packaging (right now you can only pass options, but cannot change the actual goals to execute), and then I suppose it could be reused. I think it might be misleading though to have a build Zeebe action which actually deploys, so I'd rather avoid that for now.
Related issues
related to #10017
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.