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

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


The following commit(s) were added to refs/heads/master by this push:
     new ace5350  SUBMARINE-425. Optimize java style check in github actions
ace5350 is described below

commit ace5350882146215f12d0026313107d5356e2b3e
Author: Kent Yao <[email protected]>
AuthorDate: Thu Mar 12 11:30:57 2020 +0800

    SUBMARINE-425. Optimize java style check in github actions
    
    ### What is this PR for?
    
    the current java style check does not show the root cause for us.
    
    ### What type of PR is it?
    Improvement
    ### Todos
    
    ### What is the Jira issue?
    * Open an issue on Jira https://issues.apache.org/jira/browse/SUBMARINE-425
    * Put link here, and add [SUBMARINE-*Jira number*] in PR title, eg. 
[SUBMARINE-23]
    
    ### How should this be tested?
    pass GitHub action
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Kent Yao <[email protected]>
    
    Closes #224 from yaooqinn/SUBMARINE-425 and squashes the following commits:
    
    4040cd1 [Kent Yao] SUBMARINE-425. Optimize java style check in github 
actions
---
 .github/workflows/master.yml |  4 +---
 dev-support/lint-java.sh     | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 36cc0fb..cec0da3 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -90,8 +90,6 @@ jobs:
           restore-keys: |
             ${{ runner.os }}-maven-io-
       - name: Java Style
-        run: |
-          export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m  
-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
-          mvn --no-transfer-progress -DskipTests install checkstyle:check
+        run: ./dev-support/lint-java.sh
       - name: Scala Style
         run: ./dev-support/lint-scala.sh
diff --git a/dev-support/lint-java.sh b/dev-support/lint-java.sh
new file mode 100755
index 0000000..6b1dea6
--- /dev/null
+++ b/dev-support/lint-java.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m  
-Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
+mvn --no-transfer-progress install -DskipTests -pl 
"!org.apache.submarine:submarine-cloud"
+
+ERRORS=$(mvn checkstyle:check | grep ERROR)
+
+if test ! -z "$ERRORS"; then
+    echo -e "Checkstyle checks failed at following occurrences:\n$ERRORS"
+    find . -name checkstyle-output.xml | xargs cat | grep -v checkstyle | grep 
-v "<?xml"
+    exit 1
+else
+    echo -e "Checkstyle checks passed."
+fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to