Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Cancel previous jobs if PR/branch is updated #2129

Merged

Conversation

stevenhorsman
Copy link
Member

During some testing on my fork and sometimes when running PR testing I've found that I want to re-push whilst the existing CI runs are still going and I need to go in and cancel the old jobs first. This PR looks to address this.

Update our (non-callable) jobs to cancel if another push is done to the PR, or branch, or the unlikely event that another cron job is triggered in order to save time and costs running out of date jobs.

Approach based on stack overflow suggestion:
This is based on the following stack overflow suggestion: https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre which is the same approach that kata-containers uses.

Some of these feel a bit redundant as the jobs are quite short e.g. the commit-message-check, but I
figured that for consistency's sake there wasn't any harm in updating these anyway.

Update our (non-callable) jobs to cancel if another
push is done to the PR, or branch, or the unlikely event that
another cron job is triggered in order to save time and costs
running out of date jobs.

Approach based on stack overflow suggestion:
This is based on the following stack overflow suggestion:
https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
which is the same approach that kata-containers uses.

Some of these feel a bit redundant as the jobs are
quite short e.g. the commit-message-check, but I
figured that for consistency's sake there wasn't any
harm in updating these anyway.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
@stevenhorsman stevenhorsman added the CI Issues related to CI workflows label Oct 24, 2024
@stevenhorsman stevenhorsman requested a review from a team as a code owner October 24, 2024 09:19
Copy link
Member

@wainersm wainersm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @stevenhorsman !

Copy link
Collaborator

@mkulke mkulke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good improvement!

@stevenhorsman stevenhorsman merged commit 3d92e2d into confidential-containers:main Oct 25, 2024
21 checks passed
@stevenhorsman stevenhorsman deleted the gha-concurrency branch October 25, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Issues related to CI workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants