Skip to content

Commit

Permalink
ci: break old ci jobs when new commits are pushed so we don't fill up…
Browse files Browse the repository at this point in the history
… the queue

If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that we don't waste CI time, and returns results quicker.

Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Feb 17, 2024
1 parent ef60d1f commit 0c6dab8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
merge_group:
types: [checks_requested]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
audit:
if: ${{ github.repository_owner == 'rustic-rs' }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
merge_group:
types: [checks_requested]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
fmt:
name: Rustfmt
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cross-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
cross-check:
name: Cross checking ${{ matrix.job.target }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
merge_group:
types: [checks_requested]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
style:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/prebuilt-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
env:
BINARY_NAME: rustic-scheduler

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pr-build:
if: ${{ github.event.label.name == 'S-build' && github.repository_owner == 'rustic-rs' }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
# options:
# - rustic_scheduler

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
determine-package:
name: Determine package to release
Expand Down

0 comments on commit 0c6dab8

Please sign in to comment.