Skip to content

Commit e77d7a3

Browse files
committed
Auto merge of #12477 - Kobzol:ci-concurrency-group, r=flip1995
CI: replace `cancel-outdated-builds` with `concurrency` group This is the last remaining [usage](https://github.com/search?q=org%3Arust-lang%20cancel-outdated-builds&type=code) of the [cancel-outdated-builds](https://github.com/rust-lang/simpleinfra/tree/master/github-actions/cancel-outdated-builds) CI action. Which means that if we remove its usage, we can remove the code of the action :) This action was replaced in `rust-lang/rust` with the native Github Actions `concurrency` group [last year](rust-lang/rust#112955). Note that unlike `rust-lang/rust`, which explicitly allows parallel try builds, `clippy` did not allow them, as all steps of the `clippy_bors.yaml` workflow used the `cancel-outdated-builds` action, regardless of the branch. So the new `concurrency` group mirrors that, which makes it a bit simpler than on `rust-lang/rust`. changelog: none r? `@Mark-Simulacrum`
2 parents a75e271 + 11c2bad commit e77d7a3

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

.github/workflows/clippy.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ env:
2626
NO_FMT_TEST: 1
2727
CARGO_INCREMENTAL: 0
2828

29+
concurrency:
30+
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
31+
# If the push is not attached to a PR, we will cancel all builds on the same branch.
32+
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
33+
cancel-in-progress: true
34+
2935
jobs:
3036
base:
3137
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
3238
runs-on: ubuntu-latest
3339

3440
steps:
3541
# Setup
36-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
37-
with:
38-
github_token: "${{ secrets.github_token }}"
39-
4042
- name: Checkout
4143
uses: actions/checkout@v4
4244

.github/workflows/clippy_bors.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ env:
1212
NO_FMT_TEST: 1
1313
CARGO_INCREMENTAL: 0
1414

15+
concurrency:
16+
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
17+
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
18+
cancel-in-progress: true
19+
1520
defaults:
1621
run:
1722
shell: bash
@@ -21,10 +26,6 @@ jobs:
2126
runs-on: ubuntu-latest
2227

2328
steps:
24-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
25-
with:
26-
github_token: "${{ secrets.github_token }}"
27-
2829
- name: Checkout
2930
uses: actions/checkout@v4
3031
with:
@@ -67,10 +68,6 @@ jobs:
6768
# NOTE: If you modify this job, make sure you copy the changes to clippy.yml
6869
steps:
6970
# Setup
70-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
71-
with:
72-
github_token: "${{ secrets.github_token }}"
73-
7471
- name: Checkout
7572
uses: actions/checkout@v4
7673

@@ -131,10 +128,6 @@ jobs:
131128

132129
steps:
133130
# Setup
134-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
135-
with:
136-
github_token: "${{ secrets.github_token }}"
137-
138131
- name: Checkout
139132
uses: actions/checkout@v4
140133

@@ -155,10 +148,6 @@ jobs:
155148

156149
steps:
157150
# Setup
158-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
159-
with:
160-
github_token: "${{ secrets.github_token }}"
161-
162151
- name: Checkout
163152
uses: actions/checkout@v4
164153

@@ -211,10 +200,6 @@ jobs:
211200

212201
steps:
213202
# Setup
214-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
215-
with:
216-
github_token: "${{ secrets.github_token }}"
217-
218203
- name: Checkout
219204
uses: actions/checkout@v4
220205

0 commit comments

Comments
 (0)