From e1768913b8da025670ddbe58a090927dd7ff1c98 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 25 Feb 2022 11:19:09 +0100 Subject: [PATCH] Cancel the workflows in progress in newer build is about to start (#11) --- .github/workflows/bench.yml | 5 +++++ .github/workflows/cloc.yml | 6 ++++++ .github/workflows/golangci-lint.yml | 6 ++++++ .github/workflows/gorelease.yml | 6 ++++++ .github/workflows/test-unit.yml | 8 +++++++- go.mod | 2 +- go.sum | 4 ++-- 7 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 152d4a6..d4b3952 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -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. diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml index 7002b22..d6ff20d 100644 --- a/.github/workflows/cloc.yml +++ b/.github/workflows/cloc.yml @@ -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 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index a5c9b47..ab81105 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -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 diff --git a/.github/workflows/gorelease.yml b/.github/workflows/gorelease.yml index 94c6966..f8169e6 100644 --- a/.github/workflows/gorelease.yml +++ b/.github/workflows/gorelease.yml @@ -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: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index a90a1ae..036e70b 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -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. @@ -14,7 +20,7 @@ jobs: test: strategy: matrix: - go-version: [ 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, tip ] + go-version: [ 1.16.x, 1.17.x, tip ] runs-on: ubuntu-latest steps: - name: Install Go stable diff --git a/go.mod b/go.mod index 9794b55..4a55807 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/bool64/ctxd go 1.17 require ( - github.com/bool64/dev v0.2.6 + github.com/bool64/dev v0.2.7 github.com/stretchr/testify v1.7.0 github.com/swaggest/usecase v1.1.2 ) diff --git a/go.sum b/go.sum index 2662f84..274086d 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/bool64/dev v0.2.5/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU= -github.com/bool64/dev v0.2.6 h1:sMqjLqAX1fwk29k7s2DlHjIBFEKPmx0x8QEn0JShkJY= -github.com/bool64/dev v0.2.6/go.mod h1:/csLrm+4oDSsKJRIVS0mrywAonLnYKFG8RvGT7Jh9b8= +github.com/bool64/dev v0.2.7 h1:Zs1mCSJJwe8zBGLrlQ6pjuVUJjQtYbQslvxBwlzrYqo= +github.com/bool64/dev v0.2.7/go.mod h1:/csLrm+4oDSsKJRIVS0mrywAonLnYKFG8RvGT7Jh9b8= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=