workflow with concurrency #33142
Replies: 3 comments 3 replies
-
|
IMHO it is currently not possible. According to docs, any pending jobs/workflows in the same concurrency group will get canceled. |
Beta Was this translation helpful? Give feedback.
-
|
concurrency is for allowing your jobs to shortcut when, for example, you have lots of pushes that trigger workflow from a branch, but only care about the latest results, not the one in the middle... (say your workflow takes 10 minutes, and you push every 2 mins a set of small changes... without concurrency, you'll have a new set of actions triggered for each push. With concurrency, you can abort already running and/or queued jobs that would do the same thing on obsolete refs to not waste time on them, and getting to the final run you need much faster). Now, the easiest way would be to combine those jobs in one large workflow, so you can setup the proper dependencies between each job, so they can run sequentially (using Assuming the following structure: each workflow (say a through f) contains 3 jobs (1,2,3). Now, when the "original trigger" happens (whatever the event, user/push/pr/etc trigger), only the first workflow is started. this will create jobs 1 2 3 with the dependencies defined there. Once they are all complete, job 4 (which depends on all 3) is then run, which triggers the workblow-b. that then creates the jobs 1,2,3 from workflow b, etc... There will be interesting corner cases to explore when you cancel things mid-way through (either through the concurrency and/or through the UI by hand). For example, if you have concurrency set, but the run is past the first workflow, you'll end up in a position where it won't be cancelled those workflow-b though f until the new workflow catches up in the chain and cancel the already in progress one. There is likely things you can do to cancel all the possible actions related to that branch/ref/whatever (or previously created jobs). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have 6 workflows where requirement is to run in sequential fashion, no dependency . however at given time only one workflow out of
6 should be running.
I used concurrency as below. mentioned same group for all the 6 workflow. It works, however it triggering as 1 in progress,2 queued jobs and cancelling remaining workflow.
Expected result is 9 jobs in queue and 1 in progress. Can someone please help me
concurrency:
group: test
cancel-in-progress: false
Beta Was this translation helpful? Give feedback.
All reactions