You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by yo...@apache.org on 2021/01/29 13:01:56 UTC

[pulsar] branch master updated: Using the same job to run cancel workflow (#9357)

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

yong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 56c229c  Using the same job to run cancel workflow (#9357)
56c229c is described below

commit 56c229c3a7d129fb311ce6fa1d37d3cd1d06dc94
Author: Yong Zhang <zh...@gmail.com>
AuthorDate: Fri Jan 29 21:01:19 2021 +0800

    Using the same job to run cancel workflow (#9357)
    
    * Using the same job to run cancel workflow
    ---
    
    **Motivation**
    
    After introducing the new cancel CI workflow, it takes
    a lot of job place which cause we have more and more CI
    in the queue. I saw how the apache/airflow uses, the
    apache/airflow run it as a step, so let's remove it into
    the separate workflows. It will reduce our CI job usage.
    Also, I test it in my own repo, it looks like working well.
    https://github.com/zymap/pulsar/actions?query=branch%3Atest-duplicate-ci'
---
 .github/workflows/cancel-duplicates.yml            | 62 ----------------------
 .github/workflows/ci-build-macos.yaml              |  5 ++
 .github/workflows/ci-cpp.yaml                      |  5 ++
 .github/workflows/ci-go-functions-style.yaml       |  5 ++
 .github/workflows/ci-go-functions-test.yaml        |  5 ++
 .../ci-integration-backwards-compatibility.yaml    |  5 ++
 .github/workflows/ci-integration-cli.yaml          |  5 ++
 .../workflows/ci-integration-function-state.yaml   |  5 ++
 .github/workflows/ci-integration-messaging.yaml    |  5 ++
 .github/workflows/ci-integration-process.yaml      |  6 ++-
 .github/workflows/ci-integration-schema.yaml       |  6 ++-
 .github/workflows/ci-integration-sql.yaml          |  6 ++-
 .github/workflows/ci-integration-standalone.yaml   |  6 ++-
 .github/workflows/ci-integration-thread.yaml       |  6 ++-
 .../ci-integration-tiered-filesystem.yaml          |  6 ++-
 .../workflows/ci-integration-tiered-jcloud.yaml    |  6 ++-
 .github/workflows/ci-integration-transaction.yaml  |  6 ++-
 .github/workflows/ci-license.yaml                  |  5 ++
 .github/workflows/ci-pulsar-website-build.yaml     |  5 ++
 .github/workflows/ci-shade-test.yaml               |  5 ++
 .github/workflows/ci-unit-broker-broker-gp1.yaml   |  5 ++
 .github/workflows/ci-unit-broker-broker-gp2.yaml   |  5 ++
 .github/workflows/ci-unit-broker-client-api.yaml   |  5 ++
 .github/workflows/ci-unit-broker-client-impl.yaml  |  5 ++
 .github/workflows/ci-unit-broker-other.yaml        |  5 ++
 .github/workflows/ci-unit-proxy.yaml               |  5 ++
 .github/workflows/ci-unit.yaml                     |  5 ++
 27 files changed, 130 insertions(+), 70 deletions(-)

diff --git a/.github/workflows/cancel-duplicates.yml b/.github/workflows/cancel-duplicates.yml
deleted file mode 100644
index c737dff..0000000
--- a/.github/workflows/cancel-duplicates.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-name: Cancelling Duplicates
-on:
-  workflow_run:
-    workflows: 
-      - 'CI - Build - MacOS'
-      - 'CI - CPP, Python Tests'
-      - 'CI - Go Functions style check'
-      - 'CI - Go Functions Tests'
-      - 'CI - Integration - Backwards Compatibility'
-      - 'CI - Integration - Cli'
-      - 'CI - Integration - Function State'
-      - 'CI - Integration - Messaging'
-      - 'CI - Integration - Process'
-      - 'CI - Integration - Schema'
-      - 'CI - Integration - Sql'
-      - 'CI - Integration - Standalone'
-      - 'CI - Integration - Thread'
-      - 'CI - Integration - Tiered FileSystem'
-      - 'CI - Integration - Tiered JCloud'
-      - 'CI - Integration - Transaction'
-      - 'CI - Misc'
-      - 'CI - Pulsar Website build'
-      - 'CI - Shade - Test'
-      - 'CI - Unit - Brokers - Broker Group 1'
-      - 'CI - Unit - Brokers - Broker Group 2'
-      - 'CI - Unit - Brokers - Client Api'
-      - 'CI - Unit - Brokers - Client Impl'
-      - 'CI - Unit - Brokers - Other'
-      - 'CI - Unit - Proxy'
-      - 'CI - Unit'
-    types: ['requested']
-
-jobs:
-  cancel-duplicate-workflow-runs:
-    name: "Cancel duplicate workflow runs"
-    runs-on: ubuntu-latest
-    steps:
-      - uses: potiuk/cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738 # @master
-        name: "Cancel duplicate workflow runs"
-        with:
-          cancelMode: allDuplicates
-          token: ${{ secrets.GITHUB_TOKEN }}
-          sourceRunId: ${{ github.event.workflow_run.id }}
diff --git a/.github/workflows/ci-build-macos.yaml b/.github/workflows/ci-build-macos.yaml
index a7dd482..8cc5a33 100644
--- a/.github/workflows/ci-build-macos.yaml
+++ b/.github/workflows/ci-build-macos.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-cpp.yaml b/.github/workflows/ci-cpp.yaml
index d4991e9..a9d13b4 100644
--- a/.github/workflows/ci-cpp.yaml
+++ b/.github/workflows/ci-cpp.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-go-functions-style.yaml b/.github/workflows/ci-go-functions-style.yaml
index 80d7e51..710c2fd 100644
--- a/.github/workflows/ci-go-functions-style.yaml
+++ b/.github/workflows/ci-go-functions-style.yaml
@@ -45,6 +45,11 @@ jobs:
         go-version: [1.11, 1.12, 1.13, 1.14]
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: Check out code into the Go module directory
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-go-functions-test.yaml b/.github/workflows/ci-go-functions-test.yaml
index fa7543b..552eabc 100644
--- a/.github/workflows/ci-go-functions-test.yaml
+++ b/.github/workflows/ci-go-functions-test.yaml
@@ -47,6 +47,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: Check out code into the Go module directory
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-backwards-compatibility.yaml b/.github/workflows/ci-integration-backwards-compatibility.yaml
index b65c136..440e2a6 100644
--- a/.github/workflows/ci-integration-backwards-compatibility.yaml
+++ b/.github/workflows/ci-integration-backwards-compatibility.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-cli.yaml b/.github/workflows/ci-integration-cli.yaml
index a1e0b45..b7d22d5 100644
--- a/.github/workflows/ci-integration-cli.yaml
+++ b/.github/workflows/ci-integration-cli.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-function-state.yaml b/.github/workflows/ci-integration-function-state.yaml
index 77df3fd..f007e2a 100644
--- a/.github/workflows/ci-integration-function-state.yaml
+++ b/.github/workflows/ci-integration-function-state.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-messaging.yaml b/.github/workflows/ci-integration-messaging.yaml
index 2c3f299..bf67b18 100644
--- a/.github/workflows/ci-integration-messaging.yaml
+++ b/.github/workflows/ci-integration-messaging.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-process.yaml b/.github/workflows/ci-integration-process.yaml
index 783c963..e01b5e5 100644
--- a/.github/workflows/ci-integration-process.yaml
+++ b/.github/workflows/ci-integration-process.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   process:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-schema.yaml b/.github/workflows/ci-integration-schema.yaml
index 412e972..339f9a6 100644
--- a/.github/workflows/ci-integration-schema.yaml
+++ b/.github/workflows/ci-integration-schema.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   schema:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-sql.yaml b/.github/workflows/ci-integration-sql.yaml
index a394248..b88ea9f 100644
--- a/.github/workflows/ci-integration-sql.yaml
+++ b/.github/workflows/ci-integration-sql.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   sql:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-standalone.yaml b/.github/workflows/ci-integration-standalone.yaml
index 5f44a15..5405461 100644
--- a/.github/workflows/ci-integration-standalone.yaml
+++ b/.github/workflows/ci-integration-standalone.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   standalone:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-thread.yaml b/.github/workflows/ci-integration-thread.yaml
index 4f2ad19..326555b 100644
--- a/.github/workflows/ci-integration-thread.yaml
+++ b/.github/workflows/ci-integration-thread.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   thread:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-tiered-filesystem.yaml b/.github/workflows/ci-integration-tiered-filesystem.yaml
index 4fb4d29..9f596ae 100644
--- a/.github/workflows/ci-integration-tiered-filesystem.yaml
+++ b/.github/workflows/ci-integration-tiered-filesystem.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   tiered-filesystem:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-tiered-jcloud.yaml b/.github/workflows/ci-integration-tiered-jcloud.yaml
index 160aaa5..b8695e3 100644
--- a/.github/workflows/ci-integration-tiered-jcloud.yaml
+++ b/.github/workflows/ci-integration-tiered-jcloud.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   tiered-jcloud:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-integration-transaction.yaml b/.github/workflows/ci-integration-transaction.yaml
index 4fe08c8..353cc32 100644
--- a/.github/workflows/ci-integration-transaction.yaml
+++ b/.github/workflows/ci-integration-transaction.yaml
@@ -32,11 +32,15 @@ env:
 jobs:
 
   transaction:
-    name:
     runs-on: ubuntu-latest
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-license.yaml b/.github/workflows/ci-license.yaml
index 1e27643..06331ee 100644
--- a/.github/workflows/ci-license.yaml
+++ b/.github/workflows/ci-license.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 60
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-pulsar-website-build.yaml b/.github/workflows/ci-pulsar-website-build.yaml
index 388c2c4..d2b1026 100644
--- a/.github/workflows/ci-pulsar-website-build.yaml
+++ b/.github/workflows/ci-pulsar-website-build.yaml
@@ -31,6 +31,11 @@ jobs:
     runs-on: ubuntu-latest
     timeout-minutes: 120
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
 
diff --git a/.github/workflows/ci-shade-test.yaml b/.github/workflows/ci-shade-test.yaml
index ddbf639..9552d4f 100644
--- a/.github/workflows/ci-shade-test.yaml
+++ b/.github/workflows/ci-shade-test.yaml
@@ -37,6 +37,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit-broker-broker-gp1.yaml b/.github/workflows/ci-unit-broker-broker-gp1.yaml
index b54d363..372f9d7 100644
--- a/.github/workflows/ci-unit-broker-broker-gp1.yaml
+++ b/.github/workflows/ci-unit-broker-broker-gp1.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 45
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit-broker-broker-gp2.yaml b/.github/workflows/ci-unit-broker-broker-gp2.yaml
index 284924c..250d64a 100644
--- a/.github/workflows/ci-unit-broker-broker-gp2.yaml
+++ b/.github/workflows/ci-unit-broker-broker-gp2.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit-broker-client-api.yaml b/.github/workflows/ci-unit-broker-client-api.yaml
index 9e8512c..7f6e1a9 100644
--- a/.github/workflows/ci-unit-broker-client-api.yaml
+++ b/.github/workflows/ci-unit-broker-client-api.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit-broker-client-impl.yaml b/.github/workflows/ci-unit-broker-client-impl.yaml
index 989be86..4833fc4 100644
--- a/.github/workflows/ci-unit-broker-client-impl.yaml
+++ b/.github/workflows/ci-unit-broker-client-impl.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit-broker-other.yaml b/.github/workflows/ci-unit-broker-other.yaml
index ac3d53d..e0c8e64 100644
--- a/.github/workflows/ci-unit-broker-other.yaml
+++ b/.github/workflows/ci-unit-broker-other.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit-proxy.yaml b/.github/workflows/ci-unit-proxy.yaml
index 193baea..359700f 100644
--- a/.github/workflows/ci-unit-proxy.yaml
+++ b/.github/workflows/ci-unit-proxy.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with:
diff --git a/.github/workflows/ci-unit.yaml b/.github/workflows/ci-unit.yaml
index 886bf77..ee321e3 100644
--- a/.github/workflows/ci-unit.yaml
+++ b/.github/workflows/ci-unit.yaml
@@ -39,6 +39,11 @@ jobs:
     timeout-minutes: 120
 
     steps:
+      - name: cancel previous runs
+        uses: apache/airflow-cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
       - name: checkout
         uses: actions/checkout@v2
         with: