brew icon indicating copy to clipboard operation
brew copied to clipboard

Deduplicate GitHub Actions Usage

Open MikeMcQuaid opened this issue 4 years ago • 8 comments
trafficstars

Provide a detailed description of the proposed feature

Homebrew/homebrew-core and Homebrew/linuxbrew-core (and, to a much lesser extent, Homebrew/brew) have a huge amount of duplication and copy-paste between actions that differ in very small ways. These should be deduplicated and move of their logic moved to Homebrew/actions.

Composite actions (https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action) may be a simple way to simplify some of these workflow files and keep them in sync.

What is the motivation for the feature?

Reducing complexity due to repeated duplication in GitHub Actions workflow files.

How will the feature be relevant to at least 90% of Homebrew users?

More reliable CI.

What alternatives to the feature have been considered?

Not doing this.

MikeMcQuaid avatar Apr 10 '21 18:04 MikeMcQuaid

I've spent some time on this, posting the findings here.

Composite actions don't support setting conditionals, continue-on-error, timeout-minutes, "uses", and secrets on individual steps within a composite action right now. (Reference: https://github.com/actions/runner/issues/646)

The actions which we want to be deduplicated use one of the above unsupported statements/features. We'll have to park this idea until then.

As of now, we can only use composite actions to replace a bunch of run statements, which is a very narrow use case.

GauthamGoli avatar May 30 '21 04:05 GauthamGoli

Thanks @GauthamGoli! Looks like composite actions are a non-starter for now, indeed. Do you have any other ideas on how to deduplicate? Perhaps we could have e.g. a single workflow that takes more inputs?

MikeMcQuaid avatar May 31 '21 11:05 MikeMcQuaid

@MikeMcQuaid yeah, using a single workflow seems promising. I will open a PR if it works!

GauthamGoli avatar Jun 06 '21 04:06 GauthamGoli

Can we do something like process scheduling, like in apt?

xakep8 avatar Apr 15 '22 19:04 xakep8

@xakep8 I'm not sure I understand the question, please elaborate!

MikeMcQuaid avatar Apr 18 '22 08:04 MikeMcQuaid

Hi there, I want to ask about this issue. From what I understand, homebrew has a custom action repository in here. So, if I want to create new composite action I should place the composite action in there and then use it on other repository. Is that the correct flow?

mohzulfikar avatar Jun 15 '22 13:06 mohzulfikar

Yes

dawidd6 avatar Jun 15 '22 20:06 dawidd6

Thank you

mohzulfikar avatar Jun 22 '22 14:06 mohzulfikar

I think this is as done as it needs to be.

MikeMcQuaid avatar Feb 22 '23 16:02 MikeMcQuaid