Skip to content

Commit

Permalink
Auto merge of #12477 - Kobzol:ci-concurrency-group, r=flip1995
Browse files Browse the repository at this point in the history
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`.

r? `@Mark-Simulacrum`
  • Loading branch information
bors committed Mar 14, 2024
2 parents a75e271 + 11c2bad commit f0556e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ env:
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0

concurrency:
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
# If the push is not attached to a PR, we will cancel all builds on the same branch.
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
base:
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
runs-on: ubuntu-latest

steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"

- name: Checkout
uses: actions/checkout@v4

Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ env:
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0

concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

defaults:
run:
shell: bash
Expand All @@ -21,10 +26,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -67,10 +68,6 @@ jobs:
# NOTE: If you modify this job, make sure you copy the changes to clippy.yml
steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"

- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -131,10 +128,6 @@ jobs:

steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"

- name: Checkout
uses: actions/checkout@v4

Expand All @@ -155,10 +148,6 @@ jobs:

steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"

- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -211,10 +200,6 @@ jobs:

steps:
# Setup
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
with:
github_token: "${{ secrets.github_token }}"

- name: Checkout
uses: actions/checkout@v4

Expand Down

0 comments on commit f0556e0

Please sign in to comment.