AO3-7341 Add concurrency-key on Automated tests#5652
Open
onefangg wants to merge 1 commit intootwcode:masterfrom
Open
AO3-7341 Add concurrency-key on Automated tests#5652onefangg wants to merge 1 commit intootwcode:masterfrom
onefangg wants to merge 1 commit intootwcode:masterfrom
Conversation
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
Member
There was a problem hiding this comment.
From this Stack Overflow comment, let's instead use:
${{ github.workflow }}-${{ github.ref || github.run_id }}
github.ref also covers pull requests, and github.run_id is guaranteed to exist on any run.
- To cancel previously queued jobs per branch head
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Checklist
No tests added here, because functionality change is just for developers.
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7341
Purpose
What does this PR do?
Cancels previous workflow runs for automated tests, if there is a newer run queued. The concurrency key is added just for automated tests as specified in the ticket, but I could also add it to
reviewdog.ymlas it also runs on pull_request trigger.Testing Instructions
After this has been merged to master, PRs that have commits pushed while the automated tests are still running will result in said tests being cancelled. ie. Automated tests will only be ran for the latest commit push, previously queued tasks will be cancelled.
Example of my own testing:
I've created the PR which creating this first test run, then made a cosmetic change to my commit message by running
git commit --amendthengit push --force-with-leaseto force a diff commit hash, resulting in the second test run being queued, which causes the first test run to be cancelledCredit
Yi Fang (she/her)