Closed p-j-smith closed 12 months ago
Seems a bit odd to use a reusable workflow to call a composite workflow? Perfectly valid, but is it needed?
Yeah it is a little convoluted. The molecule-test
action that's in our .github
repo can be used both for testing this collection as well as for testing standalone roles. When testing the roles within this collection there's a bit of boilerplate that's needed (and that we'd use for each role we want to test). So I put this boilerplate into a reusable workflow. We could have a workflow molecule-test-collection
but that would duplicate a lot of what's in the existing molecule-test
action. Roundabout way of saying it's not really necessary, just seemed like a sensible way of doing things. Happy to change though!
Roundabout way of saying it's not really necessary, just seemed like a sensible way of doing things. Happy to change though!
Happy with whatever you decide. If it's a duplication concern, I assume one composite action can depend on another (maybe)?
Happy with whatever you decide. If it's a duplication concern, I assume one composite action can depend on another (maybe)?
Yeah we could have another action molecule-test-collection
that uses the existing molecule-test
action, and have each workflow use that molecule-test-collection
. That new action would look like this:
And using it in a workflow: https://github.com/UCL-MIRSG/ansible-collection-infra/blob/0ca6652ae9ac4571dc40d5a05a6cef224cf1d8b3/.github/workflows/molecule-firewalld-with-action.yml#L1-L26
Compared to the current workflow for the same role: https://github.com/UCL-MIRSG/ansible-collection-infra/blob/0ca6652ae9ac4571dc40d5a05a6cef224cf1d8b3/.github/workflows/molecule-firewalld.yml#L1-L13
So using a reusable workflow allows us to avoid some boilerplate that can't be avoided when using a composite action
Reduce duplication in workflows by:
molecule-test
GitHub Actionprovision
andfirewalld
roles (more workflows can be added in a separate pr)Note, this depends on https://github.com/UCL-MIRSG/.github/pull/80 being merged first. And linting is broken will fix in a different pr