From a5d9997794910f6b6c192667c63ee790a6a5a48a Mon Sep 17 00:00:00 2001 From: Sachin Kumar Date: Sat, 21 Jan 2023 16:40:15 +0530 Subject: [PATCH] ci: use concurrency in github workflows (#218) --- .github/workflows/cancel.yml | 23 ----------------------- .github/workflows/nodejs.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/cancel.yml diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 9fb6d03..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Cancel -on: - push: - branches: - - master - - next - pull_request: - branches: - - master - - next -permissions: {} # none -jobs: - cancel: - permissions: - actions: write - name: Cancel Previous Runs - runs-on: ubuntu-latest - timeout-minutes: 3 - steps: - - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: nodejs.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 29e45d8..76f03b3 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -27,6 +27,10 @@ jobs: runs-on: ${{ matrix.os }} + concurrency: + group: lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }} + cancel-in-progress: true + steps: - uses: actions/checkout@v3 with: @@ -67,6 +71,10 @@ jobs: runs-on: ${{ matrix.os }} + concurrency: + group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ github.ref }} + cancel-in-progress: true + steps: - name: Setup Git if: matrix.os == 'windows-latest'