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

xianjin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new ffa26b4a [#626] chore(ci): skip build operator if no code changes 
(#628)
ffa26b4a is described below

commit ffa26b4a06f2965e562b848b50d4f70a21f84558
Author: advancedxy <[email protected]>
AuthorDate: Mon Feb 20 18:54:44 2023 +0800

    [#626] chore(ci): skip build operator if no code changes (#628)
    
    ### What changes were proposed in this pull request?
    skip build operator if no related code change in PR
    
    ### Why are the changes needed?
    Speed up and reduce power usage for CI.
    Fix: #626
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    github actions.
---
 .github/workflows/build.yml   |  6 +++++-
 .github/workflows/changes.yml | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 76700b77..a0264af1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -24,6 +24,9 @@ concurrency:
   cancel-in-progress: ${{ github.event_name == 'pull_request' }}
 
 jobs:
+  changes:
+    uses: ./.github/workflows/changes.yml
+
   checkstyle:
     uses: ./.github/workflows/sequential.yml
     with:
@@ -75,7 +78,8 @@ jobs:
       reports-path: "**/target/surefire-reports/*.txt"
 
   kubernetes:
-    needs: [checkstyle, license] # delay execution
+    needs: [checkstyle, license, changes] # delay execution
+    if: needs.changes.output.kubernetes == 'true' ||  github.event_name == 
'push'
     uses: ./.github/workflows/single.yml
     with:
       maven-args: package -Pkubernetes -DskipUTs -DskipITs
diff --git a/.github/workflows/changes.yml b/.github/workflows/changes.yml
new file mode 100644
index 00000000..318e0194
--- /dev/null
+++ b/.github/workflows/changes.yml
@@ -0,0 +1,41 @@
+#
+# 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: Change detection
+
+on:
+  workflow_call:
+    outputs:
+      kubernetes:
+        description: "whether current workflow touches deploy/kubernetes dir 
or not"
+        value: ${{ jobs.changes.outputs.kubernetes }}
+
+jobs:
+  changes:
+    runs-on: ubuntu-20.04
+    name: detect
+    steps:
+      - name: Checkout project
+        uses: actions/checkout@v3
+      - uses: dorny/paths-filter@v2
+        id: filter
+        with:
+          filters: |
+            kubernetes:
+              - 'deploy/kubernetes/**'
+    outputs:
+      kubernetes: ${{ steps.filter.outputs.kubernetes }}

Reply via email to