This is an automated email from the ASF dual-hosted git repository.

chenjunxu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a14486  ci: cancel duplicate workflow to reduce CI queue time (#1795)
8a14486 is described below

commit 8a14486f1583fdc4b478e50a94ce188157488019
Author: Shuyang Wu <[email protected]>
AuthorDate: Thu Apr 22 14:14:57 2021 +0800

    ci: cancel duplicate workflow to reduce CI queue time (#1795)
---
 .github/workflows/backend-e2e-test.yml             |  1 +
 .github/workflows/deploy-with-docker.yml           |  2 ++
 .github/workflows/frontend-e2e-test.yml            |  3 +++
 .github/workflows/frontend-plugin-e2e-test.yml     |  3 +++
 .github/workflows/make-build.yaml                  |  2 ++
 .../test-frontend-multiple-node-build.yml          |  2 ++
 .github/workflows/workflow-cancel.yaml             | 29 ++++++++++++++++++++++
 .gitmodules                                        |  3 +++
 8 files changed, 45 insertions(+)

diff --git a/.github/workflows/backend-e2e-test.yml 
b/.github/workflows/backend-e2e-test.yml
index a7a3545..fb7081b 100644
--- a/.github/workflows/backend-e2e-test.yml
+++ b/.github/workflows/backend-e2e-test.yml
@@ -25,6 +25,7 @@ jobs:
         uses: actions/[email protected]
         with:
           go-version: "1.13"
+          submodules: recursive
 
       - name: Modify conf.yaml
         run: |
diff --git a/.github/workflows/deploy-with-docker.yml 
b/.github/workflows/deploy-with-docker.yml
index 21415f1..184ab84 100644
--- a/.github/workflows/deploy-with-docker.yml
+++ b/.github/workflows/deploy-with-docker.yml
@@ -18,6 +18,8 @@ jobs:
 
     steps:
       - uses: actions/checkout@v2
+        with:
+          submodules: recursive
 
       - uses: Azure/docker-login@v1
         if: ${{ github.event_name == 'push' }}
diff --git a/.github/workflows/frontend-e2e-test.yml 
b/.github/workflows/frontend-e2e-test.yml
index a56d029..dac7e06 100644
--- a/.github/workflows/frontend-e2e-test.yml
+++ b/.github/workflows/frontend-e2e-test.yml
@@ -33,6 +33,9 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v2
+        with:
+          submodules: recursive
+
       - name: Setup Node.js environment
         uses: actions/[email protected]
         with:
diff --git a/.github/workflows/frontend-plugin-e2e-test.yml 
b/.github/workflows/frontend-plugin-e2e-test.yml
index 5514ba6..d1d7e8f 100644
--- a/.github/workflows/frontend-plugin-e2e-test.yml
+++ b/.github/workflows/frontend-plugin-e2e-test.yml
@@ -31,6 +31,9 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v2
+        with:
+          submodules: recursive
+
       - name: Setup Node.js environment
         uses: actions/[email protected]
         with:
diff --git a/.github/workflows/make-build.yaml 
b/.github/workflows/make-build.yaml
index f6ee180..211bf68 100644
--- a/.github/workflows/make-build.yaml
+++ b/.github/workflows/make-build.yaml
@@ -31,6 +31,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v2
+        with:
+          submodules: recursive
 
       - name: Setup Node.js environment
         uses: actions/[email protected]
diff --git a/.github/workflows/test-frontend-multiple-node-build.yml 
b/.github/workflows/test-frontend-multiple-node-build.yml
index 6a12cc3..3301c7e 100644
--- a/.github/workflows/test-frontend-multiple-node-build.yml
+++ b/.github/workflows/test-frontend-multiple-node-build.yml
@@ -33,6 +33,8 @@ jobs:
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can 
access it
       - uses: actions/checkout@v2
+        with:
+          submodules: recursive
       - name: Use Node.js ${{ matrix.node-version }}
         uses: actions/[email protected]
         with:
diff --git a/.github/workflows/workflow-cancel.yaml 
b/.github/workflows/workflow-cancel.yaml
new file mode 100644
index 0000000..b7c750e
--- /dev/null
+++ b/.github/workflows/workflow-cancel.yaml
@@ -0,0 +1,29 @@
+name: Cancelling Duplicates
+on:
+  workflow_run:
+    workflows:
+      - 'Frontend e2e test'
+      - 'Frontend e2e test for plugin'
+      - 'Test and Deploy with Docker'
+      - 'Test building web in multiple node version'
+      - 'Backend E2E Test'
+      - 'make build'
+    types: ['requested']
+
+jobs:
+  cancel-duplicate-workflow-runs:
+    name: "Cancel duplicate workflow runs"
+    runs-on: ubuntu-latest
+    steps:
+      - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
+        uses: actions/checkout@v2
+        with:
+          submodules: recursive
+
+      - uses: ./.github/actions/cancel-workflow-runs
+        name: "Cancel duplicate workflow runs"
+        with:
+          cancelMode: allDuplicates
+          token: ${{ secrets.GITHUB_TOKEN }}
+          sourceRunId: ${{ github.event.workflow_run.id }}
+          skipEventTypes: '["push", "schedule"]'
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..10d55dc
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule ".github/actions/cancel-workflow-runs"]
+       path = .github/actions/cancel-workflow-runs
+       url = https://github.com/potiuk/cancel-workflow-runs

Reply via email to