Skip to content

Commit

Permalink
Cancel the workflows in progress in newer build is about to start (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop committed Feb 25, 2022
1 parent 69a6d8b commit 3c3b3ba
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/github/workflows/bench.yml
Expand Up @@ -12,6 +12,11 @@ on:
description: 'New Ref'
required: true

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
GO111MODULE: "on"
CACHE_BENCHMARK: "off" # Enables benchmark result reuse between runs, may skew latency results.
Expand Down
6 changes: 6 additions & 0 deletions templates/github/workflows/cloc.yml
Expand Up @@ -2,6 +2,12 @@
name: cloc
on:
pull_request:

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
cloc:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions templates/github/workflows/golangci-lint.yml
Expand Up @@ -8,6 +8,12 @@ on:
- master
- main
pull_request:

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
golangci:
name: golangci-lint
Expand Down
6 changes: 6 additions & 0 deletions templates/github/workflows/gorelease.yml
Expand Up @@ -2,6 +2,12 @@
name: gorelease
on:
pull_request:

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
GO_VERSION: 1.17.x
jobs:
Expand Down
6 changes: 6 additions & 0 deletions templates/github/workflows/test-integration.yml
Expand Up @@ -6,6 +6,12 @@ on:
- master
- main
pull_request:

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
GO111MODULE: "on"
RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing.
Expand Down
6 changes: 6 additions & 0 deletions templates/github/workflows/test-unit.yml
Expand Up @@ -6,6 +6,12 @@ on:
- master
- main
pull_request:

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
GO111MODULE: "on"
RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing.
Expand Down

0 comments on commit 3c3b3ba

Please sign in to comment.