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

[ci] Cancel outstanding workflows when new changes are added to PRs #513

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

mcbarton
Copy link
Contributor

@mcbarton mcbarton commented Feb 3, 2025

If you submit a commit to a PR at the moment and then find an issue with that commit, and submit a new commit to fix the PR before the ci has finished then the ci runs fully for both commits. This PR makes sure that if a new commit is submitted the old ci run is cancelled. This should save on Github runner minutes, ensuring that the slow down across the organisation due to Github runner consumed minutes is less pronounced.

@mcbarton mcbarton changed the title Don't have more than one ci job running on main or individual PRs at the same time [ci] Cancel outstanding workflows when new changes are added to PRs Feb 4, 2025
@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 4, 2025

@sbc100 pinging for review. Its the same change I made in wasi-libc here WebAssembly/wasi-libc#571

@sbc100
Copy link
Member

sbc100 commented Feb 4, 2025

The folks over in the binaryen repo are saying that they have observed this to be the default: WebAssembly/binaryen#7269. Are you sure its not happening already today?

@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 4, 2025

@sbc100 This is not the default. Here is an example. In this PR #509 I put in a commit 1 hour ago https://github.com/WebAssembly/wasi-sdk/actions/runs/13137913398 and it was broken, so I put in another commit shortly afterwards before this ci run had finished here https://github.com/WebAssembly/wasi-sdk/actions/runs/13138053034 . As you can see, the first ci run carried on running despite me putting in a new commit. Also the default behaviour is explained here in the Github documentation https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs#example-using-concurrency-and-the-default-behavior , which is not to cancel in progress jobs.

@sbc100 sbc100 merged commit 30a64fd into WebAssembly:main Feb 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants