Skip to content

Commit f715119

Browse files
authored
[CI] Cancel previous run when new commit pushed (#11941)
In quite some PRs, we may need to push commits when the run is still in progress. Currently we will run all the workflow to the end by default, which is somehow a waste of machine resource. This PR use https://docs.github.com/en/actions/using-jobs/using-concurrency to group tests for Linux and Windows pre-commit tests, and cancel-in-progress if new commits are pushed.
1 parent 2f644e3 commit f715119

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/sycl_linux_precommit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ on:
2121
- 'devops/containers/**'
2222
- 'devops/actions/build_container/**'
2323

24+
concurrency:
25+
# Cancel a currently running workflow from the same PR, branch or tag.
26+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
2429
jobs:
2530
detect_changes:
2631
uses: ./.github/workflows/sycl_detect_changes.yml

.github/workflows/sycl_windows_precommit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
permissions:
2424
contents: read
2525

26+
concurrency:
27+
# Cancel a currently running workflow from the same PR, branch or tag.
28+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
29+
cancel-in-progress: true
30+
2631
jobs:
2732
detect_changes:
2833
uses: ./.github/workflows/sycl_detect_changes.yml

0 commit comments

Comments
 (0)