Allow GitHub Actions matrix exclusions to take an array #7835
Replies: 4 comments 3 replies
-
Ditto for |
Beta Was this translation helpful? Give feedback.
-
Hi @alexedwardjones - unfortunately, no, In other words - this is legal: strategy:
matrix:
a: [one, two]
b:
- ['1', '2']
- ['3', '4'] which would produce a four element matrix This is also legal: strategy:
matrix:
a: [one, two]
b:
- ['1', '2']
- ['3', '4']
exclude:
- a: two
b: ['3', '4'] Which will remove the I mention this not to dismiss your problem, but because these more advanced matrix scenarios might also be able to solve your problem. But if not, in the new year, I'd like to make complex workflows easier to specify and will keep your workflows in mind. Thanks much for the feedback. |
Beta Was this translation helpful? Give feedback.
-
To build on @chrispat's suggestion, in multiple Python projects we use dynamic matrix generation intensively, in order to work around GitHub Action's limitations to deal with global variables/env, and for complex matrix/job/task definition. pyTooling/Actions: Reusable workflows is a pipeline (workflow) composed by 10+ reusable workflows. The first of them, A particularly interesting feature is comparing the following three cases:
umarcor/umarcor: Gource uses a similar strategy, but the stringified input is passed to a Composite Action, instead of a Reusable Wokrflow.:
hdl/containers combines ouputs/inputs with Python scripts, JS Actions, Composite Actions, Reusable Workflows and Dispatchable workflows:
Overall, after the enhancements introduced in recent months (Reusable Workflows and Composite Actions with conditional steps, and which can use |
Beta Was this translation helpful? Give feedback.
-
Just found that issue since I searched for a way of doing multiple include / exclude I understand the reasoning that the existing keywords , but what about adding new keywords, because reusable workflow and combined workflow might solve some problems, at some point they become ugly workaround or do ont work at all with reasonable afford. |
Beta Was this translation helpful? Give feedback.
-
I have a job in one of my workflows that includes quite a large matrix with a lot of different combinations. I have an ever increasing number of exclude fields but I want to keep everything consolidated in one job.
The exclude list is getting quite long and doesn't seem to support providing an array which would shorten it significantly. Is this possible?
So...
...would become...
Beta Was this translation helpful? Give feedback.
All reactions