Use the native concurrency
property to cancel workflows (#4572)
I noticed that some of our workflows aren't getting cancelled when a new one has been triggered, so we ended up having a long queue in our CI when multiple changes are triggered in a short period.
Looking at the comment here, I noticed the list of workflow IDs are outdated and no longer exist, and some new ones are missing:
dfcb3363c7/.github/workflows/cancel-previous-runs.yml (L12-L13)
I attempted to update these, and came across this comment on the [`cancel-workflow-action`](https://github.com/styfle/cancel-workflow-action) repo:
> You probably don't need to install this custom action.
>
> Instead, use the native [concurrency](https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/) property to cancel workflows, for example:
So I thought instead of updating the workflow and maintaining the workflow IDs, perhaps we can try experimenting the [native `concurrency` property](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency).
This commit is contained in:
parent
842b42297b
commit
ca050053bf
4
.github/workflows/book.yml
vendored
4
.github/workflows/book.yml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- unstable
|
- unstable
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-upload-to-s3:
|
build-and-upload-to-s3:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
14
.github/workflows/cancel-previous-runs.yml
vendored
14
.github/workflows/cancel-previous-runs.yml
vendored
@ -1,14 +0,0 @@
|
|||||||
name: cancel previous runs
|
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
cancel:
|
|
||||||
name: 'Cancel Previous Runs'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 3
|
|
||||||
steps:
|
|
||||||
# https://github.com/styfle/cancel-workflow-action/releases
|
|
||||||
- uses: styfle/cancel-workflow-action@514c783324374c6940d1b92bfb962d0763d22de3 # 0.7.0
|
|
||||||
with:
|
|
||||||
# https://api.github.com/repos/sigp/lighthouse/actions/workflows
|
|
||||||
workflow_id: 697364,2434944,4462424,308241,2883401,316
|
|
||||||
access_token: ${{ github.token }}
|
|
4
.github/workflows/docker-antithesis.yml
vendored
4
.github/workflows/docker-antithesis.yml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- unstable
|
- unstable
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ANTITHESIS_PASSWORD: ${{ secrets.ANTITHESIS_PASSWORD }}
|
ANTITHESIS_PASSWORD: ${{ secrets.ANTITHESIS_PASSWORD }}
|
||||||
ANTITHESIS_USERNAME: ${{ secrets.ANTITHESIS_USERNAME }}
|
ANTITHESIS_USERNAME: ${{ secrets.ANTITHESIS_USERNAME }}
|
||||||
|
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@ -8,6 +8,10 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
4
.github/workflows/linkcheck.yml
vendored
4
.github/workflows/linkcheck.yml
vendored
@ -9,6 +9,10 @@ on:
|
|||||||
- 'book/**'
|
- 'book/**'
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linkcheck:
|
linkcheck:
|
||||||
name: Check broken links
|
name: Check broken links
|
||||||
|
4
.github/workflows/local-testnet.yml
vendored
4
.github/workflows/local-testnet.yml
vendored
@ -8,6 +8,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-local-testnet:
|
run-local-testnet:
|
||||||
strategy:
|
strategy:
|
||||||
|
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
5
.github/workflows/test-suite.yml
vendored
5
.github/workflows/test-suite.yml
vendored
@ -9,6 +9,11 @@ on:
|
|||||||
- 'pr/*'
|
- 'pr/*'
|
||||||
pull_request:
|
pull_request:
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Deny warnings in CI
|
# Deny warnings in CI
|
||||||
# Disable debug info (see https://github.com/sigp/lighthouse/issues/4005)
|
# Disable debug info (see https://github.com/sigp/lighthouse/issues/4005)
|
||||||
|
Loading…
Reference in New Issue
Block a user