From e8f34290d9806f105698cab580b7c7aefd5b4d46 Mon Sep 17 00:00:00 2001 From: Chlod Alejandro Date: Fri, 1 Mar 2024 00:40:30 +0800 Subject: [PATCH] ci: add concurrency rules --- .github/workflows/ci-cd.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 3a5003f..3018d1f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -69,6 +69,10 @@ jobs: needs: build runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}--test-browser + cancel-in-progress: true + steps: - uses: actions/checkout@v4 - name: Use Node.js latest @@ -95,6 +99,10 @@ jobs: matrix: node-version: [ 14.x, 'lts/*', latest ] + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}--test-${{ matrix.node-version }} + cancel-in-progress: true + steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} @@ -110,11 +118,15 @@ jobs: path: dist - name: Test (node) run: npm run test:node - deploy: + publish: name: Publish (npm) needs: [ test-node, test-browser ] if: ${{ startsWith( github.ref, 'refs/tags/v' ) }} + concurrency: + group: ${{ github.workflow }}--publish + cancel-in-progress: true + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4