Skip to content

Conversation

TTOzzi
Copy link
Member

@TTOzzi TTOzzi commented Apr 3, 2025

When updating a pull request that's already open, each new commit can trigger a workflow. If the PR author doesn't have permission to cancel workflows, this can lead to unnecessary executions.
To avoid redundant executions and reduce resource usage, this change cancels any in-progress workflow for the same pull request when a new one is triggered by a commit push, ensuring only one active workflow per PR.

@TTOzzi TTOzzi force-pushed the actions-concurrency branch from 45a96eb to 630052b Compare April 3, 2025 18:47
@TTOzzi
Copy link
Member Author

TTOzzi commented Apr 3, 2025

If this change looks good, I think we could also consider applying the same setup to the pull_request workflow in swift-syntax.

@shahmishal
Copy link
Member

We should look at adding this directly in the swiftlang/github-workflow repository.

@shahmishal
Copy link
Member

However, it's ok to take this now in this repository.

@TTOzzi
Copy link
Member Author

TTOzzi commented Apr 4, 2025

We should look at adding this directly in the swiftlang/github-workflow repository.

Yes, as you mentioned, it would be even better if we could apply this change across the board in swiftlang/github-workflows.
Since it's already applied to soundness (https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/soundness.yml#L83-L86), I think we only need to apply it to swift_package_test.
Would it be okay if I open a PR to github-workflows for that?

@shahmishal
Copy link
Member

Would it be okay if I open a PR to github-workflows for that?

Yes, that would be a great help. Thank you!

@TTOzzi
Copy link
Member Author

TTOzzi commented Apr 4, 2025

I’ve opened a replacement PR in swiftlang/github-workflows, so I’m closing this one.
Thank you @shahmishal 🙇

@TTOzzi TTOzzi closed this Apr 4, 2025
@TTOzzi TTOzzi reopened this Apr 4, 2025
@TTOzzi
Copy link
Member Author

TTOzzi commented Apr 4, 2025

Sorry about that — I tried making changes over in swiftlang/github-workflows, but with the functionality currently provided by GitHub, it seems impossible to fully support all the places where swift_package_test is used.
So I've reopened this 😓

@bnbarham
Copy link
Contributor

bnbarham commented Apr 4, 2025

Happy to take this while we work out something for github-workflows regardless. Same for swift-syntax. Thanks @TTOzzi!

@bnbarham bnbarham merged commit 58807b9 into swiftlang:main Apr 4, 2025
40 checks passed
@TTOzzi TTOzzi deleted the actions-concurrency branch April 5, 2025 01:04
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.

3 participants