I’ve encountered this same issue, but I wouldn’t consider that
max-parallel is really a solution.
I’ve both tried multiple explicit jobs in the same workflow and using a matrix, in which I use
concurrency. I have the concurrency group labeled such that it reflects a portion of the matrix jobs. I have 3 jobs in the matrix which target an environment, and I have another 3 jobs in the matrix which target a different environment. The two environments can completely work in parallel, but the jobs for a specific environment cannot. And now I need to add a third environment.
max-parallel with 1 wastes a lot of time in my case, whereas if
concurrency limited only 1 job in the group from running, it would work perfectly.
The only other workaround I can really think of is if I don’t use a matrix for all the environments, but split each environment into it’s own matrix so I can control that each environment only has 1 job running at a time, but jobs in separate environments can run in parallel. The unfortunate aspect of this approach is that it requires a decent amount of duplicate job configuration and steps.