Skip to content

Commit

Permalink
ci: use concurrency to ensure that only a single workflow (#1850)
Browse files Browse the repository at this point in the history
using the same concurrency group will run at a time
  • Loading branch information
zhangzujian committed Sep 7, 2022
1 parent 83b867a commit 82db50f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build-arm64-image.yaml
Expand Up @@ -14,6 +14,10 @@ on:
- 'docs/**'
- '**.md'

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.18'

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-windows.yaml
Expand Up @@ -15,6 +15,10 @@ on:
- 'docs/**'
- '**.md'

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.18'
GOSEC_VERSION: '2.12.0'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-x86-image.yaml
Expand Up @@ -15,6 +15,10 @@ on:
- 'docs/**'
- '**.md'

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.18'
GOSEC_VERSION: '2.12.0'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql-analysis.yml
Expand Up @@ -14,6 +14,10 @@ on:
schedule:
- cron: '0 17 * * 2'

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down Expand Up @@ -42,7 +46,7 @@ jobs:
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yaml
Expand Up @@ -8,6 +8,10 @@ on:
- main
pull_request:

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.18'

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/push-multiarch-image.yaml
Expand Up @@ -8,6 +8,10 @@ on:
types:
- completed

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
build:
name: Push multi arch images
Expand Down

0 comments on commit 82db50f

Please sign in to comment.