Skip to content

Commit

Permalink
Cancel previous GH Actions after push (#174)
Browse files Browse the repository at this point in the history
When pushing several changes to a pull request, I don't think we need to continue running the actions (particularly benchmarking) for the old commits. This should cancel any still-running workflows when a new commit is pushed.
  • Loading branch information
jridgewell authored Jul 28, 2022
1 parent 81feaa9 commit 118afe3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/bench_against_node_nft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
CARGO_PROFILE_RELEASE_LTO: true
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
bench_vs_node_nft:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/bench_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:
CARGO_PROFILE_RELEASE_LTO: true
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
bench:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
test:
strategy:
Expand Down

0 comments on commit 118afe3

Please sign in to comment.