Skip to content

Commit

Permalink
Use concurrency groups to cancel running workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Nov 30, 2021
1 parent 0a31878 commit 9f8a3cc
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ env:
GIT_NAME: NGINX Kubernetes Team
GIT_MAIL: kubernetes@nginx.com

concurrency:
group: ${{ github.ref_name }}-ci
cancel-in-progress: true

jobs:

checks:
Expand All @@ -44,10 +48,6 @@ jobs:
go_version: ${{ steps.vars.outputs.go_version }}
go_path: ${{ steps.go.outputs.go_path }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Cache Go controller tools
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
schedule:
- cron: '36 6 * * 4'

concurrency:
group: ${{ github.ref_name }}-codeql
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand All @@ -20,10 +24,6 @@ jobs:
language: [ 'go', 'python' ]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v2

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
paths:
- README.md
- .github/workflows/dockerhub-description.yml

concurrency:
group: ${{ github.ref_name }}-dockerhub
cancel-in-progress: true


jobs:
dockerHubDescription:
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2

- name: Modify readme for DockerHub
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ on:
- 'examples/**'
- '**.md'

concurrency:
group: ${{ github.ref_name }}-fossa
cancel-in-progress: true

jobs:

scan:
name: Fossa
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Scan
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ defaults:
env:
GOLANGCI_TIMEOUT: 10m0s

concurrency:
group: ${{ github.ref_name }}-lint
cancel-in-progress: true

jobs:

lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Lint Code
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
types:
- completed

concurrency:
group: ${{ github.ref_name }}-sync
cancel-in-progress: true

jobs:
# This job sync this repo to our internal repo
repo-sync:
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Repo Sync
uses: wei/git-sync@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ env:
DOCKER_BUILDKIT: 1
K8S_TIMEOUT: 75s

concurrency:
group: ${{ github.ref_name }}-update
cancel-in-progress: true

jobs:

variables:
Expand Down

0 comments on commit 9f8a3cc

Please sign in to comment.