Cancel in-progress CI jobs for the same branch #1329
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a concurrency group to the builds so that only one build for a branch can run at the same time. When pushing a new commit on a branch and a job is already running on that branch, the build will be cancelled to allow to build the new commit.
That's becoming more important now that we have DCO in place. It's quite easy to forget to sign-off a commit and have to rebase commits. That would trigger "useless" builds.
This PR fixes that problem.
The concurrency group is per workflow + branch WHIch means builds on other branches won't be affected.
As an example, I initially pushed without signing my commit, then had to sign + push again. That triggered two builds. The first one (https://github.com/AcademySoftwareFoundation/OpenTimelineIO/actions/runs/2521514987) as automatically cancelled and it says
Canceling since a higher priority waiting request for 'OpenTimelineIO-refs/pull/1329/merge' exists
. The second build won't have to wait as long as before to get runners.