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

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


The following commit(s) were added to refs/heads/master by this push:
     new 0bce70ae2aa Add : add a new action only focus on checkstyle check 
(#20269)
0bce70ae2aa is described below

commit 0bce70ae2aabe4cc8a9b4624a3d908babcd79830
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Thu Aug 18 20:10:00 2022 +0800

    Add : add a new action only focus on checkstyle check (#20269)
    
    * Add : add a new action only focus on checkstyle check
    
    * Refactor : update the job name
    
    * Refactor : remove maven cache from checkstyle-check action
    
    * Refactor : add back the maven cache actio which will make checkstyle 
process faster
    
    * Refactor : refactor the cache key
    
    * Refactor : remove all checkstyle check from IT, only trigger in 
checkstyle-rat-check.yaml
    
    * Refactor : refactor the checkstyle and rat check action
    
    * Refactor : refactor the action name
---
 .github/workflows/checkstyle-and-rat-check.yml | 62 ++++++++++++++++++++++++++
 .github/workflows/ci-daily.yml                 |  6 +--
 .github/workflows/ci.yml                       | 24 ++--------
 .github/workflows/it.yml                       | 14 +++---
 4 files changed, 76 insertions(+), 30 deletions(-)

diff --git a/.github/workflows/checkstyle-and-rat-check.yml 
b/.github/workflows/checkstyle-and-rat-check.yml
new file mode 100644
index 00000000000..29ec405da08
--- /dev/null
+++ b/.github/workflows/checkstyle-and-rat-check.yml
@@ -0,0 +1,62 @@
+#
+# 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.
+#
+
+# This workflow will build a Java project with Maven
+# For more information see: 
https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Checkstyle and Apache Rat Check
+
+on:
+  push:
+    branches: [ master, dev ]
+    paths:
+      - '**/src/main/**'
+      - '**/src/test/**'
+      - '.github/workflows/checkstyle-and-rat-check.yml'
+      - 'examples/shardingsphere-example-generator/**'
+      - '!examples/**'
+      - '!*.md'
+  pull_request:
+    branches: [ master ]
+    paths:
+      - '**/src/main/**'
+      - '**/src/test/**'
+      - '.github/workflows/checkstyle-and-rat-check.yml'
+      - 'examples/shardingsphere-example-generator/**'
+      - '!examples/**'
+      - '!*.md'
+
+concurrency:
+  group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  checkstyle-and-apache-rat:
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+      - uses: actions/checkout@v3
+      - name: Cache dependencies of Checkstyle and Apache Rat
+        uses: actions/cache@v3
+        with:
+          path: ~/.m2/repository
+          key: maven-cache-checkstyle-and-apache-rat-${{ 
hashFiles('**/pom.xml') }}
+      - name: Run Checkstyle and Apache Rat
+        run: ./mvnw checkstyle:check -T1C
+      - name: Run Apache Rat
+        if: github.repository == 'apache/shardingsphere'
+        run: ./mvnw apache-rat:check -T1C
diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml
index ab038241cd6..5eaf12fe3b7 100644
--- a/.github/workflows/ci-daily.yml
+++ b/.github/workflows/ci-daily.yml
@@ -25,7 +25,7 @@ on:
     - cron: '0 18 */1 * *'  # once a day. UTC time
 
 env:
-  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3  -Drat.skip=true -Dcheckstyle.skip=true
 
 jobs:
   ci:
@@ -64,7 +64,7 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Build Project
-        run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true 
-Drat.skip=true -Dcheckstyle.skip=true -DskipITs -DskipTests 
-Dspotless.apply.skip=true
+        run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true -DskipITs 
-DskipTests -Dspotless.apply.skip=true
       - name: Run Example generator
         run: ./mvnw -B test -f 
examples/shardingsphere-example-generator/pom.xml -Pexample-generator
 
@@ -80,6 +80,6 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Test with Maven
-        run: ./mvnw -B -ntp clean install cobertura:cobertura 
-Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true
+        run: ./mvnw -B -ntp clean install cobertura:cobertura 
-Dmaven.javadoc.skip=true
       - name: Upload to Codecov
         run: bash <(curl -s https://codecov.io/bash)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index faa0e0be13b..a36319f7907 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -53,27 +53,13 @@ concurrency:
   cancel-in-progress: true
 
 env:
-  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3 -Dcheckstyle.skip=true -Drat.skip=true
 
 jobs:
-  checkstyle-and-apache-rat:
-    runs-on: ubuntu-latest
-    timeout-minutes: 10
-    steps:
-      - uses: actions/checkout@v3
-      - name: Cache dependencies of Checkstyle and Apache Rat
-        uses: actions/cache@v3
-        with:
-          path: ~/.m2/repository
-          key: maven-cache-checkstyle-and-apache-rat-${{ 
hashFiles('**/pom.xml') }}
-      - name: Run Checkstyle and Apache Rat
-        run: ./mvnw checkstyle:check apache-rat:check -T1C
-
   linux:
     if: github.repository == 'apache/shardingsphere'
     name: JDK ${{ matrix.java_version }} - on ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
-    needs: checkstyle-and-apache-rat
     timeout-minutes: 60
     strategy:
       matrix:
@@ -96,7 +82,7 @@ jobs:
           restore-keys: |
             ${{ runner.os }}-maven-
       - name: Build with Maven
-        run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true 
-Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true 
-Dspotless.apply.skip=true
+        run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true 
-Djacoco.skip=true -Dspotless.apply.skip=true
       - name: Build examples with Maven
         run: ./mvnw -B -f examples/pom.xml clean package -DskipTests
   
@@ -105,7 +91,6 @@ jobs:
     if: github.repository == 'apache/shardingsphere'
     name: ShardingSphere example generator
     runs-on: ubuntu-latest
-    needs: checkstyle-and-apache-rat
     steps:
       - uses: actions/checkout@v3
       - name: Maven resolve ranges
@@ -123,7 +108,7 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Build Project
-        run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true 
-Drat.skip=true -Dcheckstyle.skip=true -DskipITs -DskipTests 
-Dspotless.apply.skip=true
+        run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true -DskipITs 
-DskipTests -Dspotless.apply.skip=true
       - name: Run Example generator
         run: ./mvnw -B test -f 
examples/shardingsphere-example-generator/pom.xml -Pexample-generator
 
@@ -131,7 +116,6 @@ jobs:
     if: github.repository == 'apache/shardingsphere'
     runs-on: ubuntu-latest
     name: ShardingSphere test coverage report
-    needs: checkstyle-and-apache-rat
     steps:
       - uses: actions/checkout@v3
       - name: Cache Maven Repos
@@ -147,6 +131,6 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Test with Maven
-        run: ./mvnw -B -ntp clean install cobertura:cobertura 
-Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true
+        run: ./mvnw -B -ntp clean install cobertura:cobertura 
-Dmaven.javadoc.skip=true
       - name: Upload to Codecov
         run: bash <(curl -s https://codecov.io/bash)
diff --git a/.github/workflows/it.yml b/.github/workflows/it.yml
index 49fac9cfb86..db277bfeaf0 100644
--- a/.github/workflows/it.yml
+++ b/.github/workflows/it.yml
@@ -60,7 +60,7 @@ concurrency:
   cancel-in-progress: true
 
 env:
-  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true 
-Drat.skip=true -Djacoco.skip=true -Dspotless.apply.skip=true
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true 
-Dcheckstyle.skip=true -Drat.skip=true -Djacoco.skip=true 
-Dspotless.apply.skip=true
 
 jobs:
   build-it-image:
@@ -126,7 +126,7 @@ jobs:
         if: matrix.adapter == 'proxy'
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f 
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml
 -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.run.modes=Cluster 
-Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter 
}} -Dit.cluster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
+        run: ./mvnw -nsu -B install -f 
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml
 -Dspotless.apply.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ 
matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} 
-Dit.cluster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
 
   it-single-rule:
     name: single rule
@@ -169,7 +169,7 @@ jobs:
         if: matrix.adapter == 'proxy'
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f 
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml
 -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER 
-Dit.cluster.adapters=${{ matrix.adapter }} -Dit.run.modes=${{ matrix.mode }} 
-Dit.cluster.databases=${{ matrix.database }} -Dit.scenarios=${{ 
matrix.scenario }}
+        run: ./mvnw -nsu -B install -f 
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml
 -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER 
-Dit.cluster.adapters=${{ matrix.adapter }} -Dit.run.modes=${{ matrix.mode }} 
-Dit.cluster.databases=${{ matrix.database }} -Dit.scenarios=${{ 
matrix.scenario }}
 
   it-mixture-rule:
     name: mixture rule
@@ -208,7 +208,7 @@ jobs:
         if: matrix.adapter == 'proxy'
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f 
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml
 -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER 
-Dit.cluster.adapters=${{ matrix.adapter }} -Dit.run.modes=${{ matrix.mode }} 
-Dit.cluster.databases=${{ matrix.database }} -Dit.scenarios=${{ 
matrix.scenario }}
+        run: ./mvnw -nsu -B install -f 
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml
 -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER 
-Dit.cluster.adapters=${{ matrix.adapter }} -Dit.run.modes=${{ matrix.mode }} 
-Dit.cluster.databases=${{ matrix.database }} -Dit.scenarios=${{ 
matrix.scenario }}
 
   mysql-proxy-agent:
     name: Agent Metrics & OpenTelemetry
@@ -230,12 +230,12 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Build Project
-        run: ./mvnw -B clean install -Dcheckstyle.skip=true -DskipITs 
-DskipTests
+        run: ./mvnw -B clean install -DskipITs -DskipTests
       - name: Verify
         run: |
           ./mvnw -B clean verify -pl 
shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics
 -DskipITs -DskipTests -Dspotless.apply.skip=true
           ./mvnw -B clean verify -pl 
shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry
 -DskipITs -DskipTests -Dspotless.apply.skip=true
       - name: Run Integration Test
         run: |
-          ./mvnw -B clean install -f 
shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml
 -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Pit.env.metrics
-          ./mvnw -B clean install -f 
shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml
 -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Pit.env.opentelemetry
+          ./mvnw -B clean install -f 
shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml
 -Dspotless.apply.skip=true -Pit.env.metrics
+          ./mvnw -B clean install -f 
shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml
 -Dspotless.apply.skip=true -Pit.env.opentelemetry

Reply via email to