From 69e9c9db7652eb3b8e7faffe2a3a9a7a1bed5607 Mon Sep 17 00:00:00 2001 From: lbw Date: Fri, 16 Apr 2021 11:47:36 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20Adding=20CI=20build?= =?UTF-8?q?=20system.=20=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maven.yml | 49 +++++++++++++++++++ .../GatewaySwaggerAutoConfiguration.java | 6 +-- .../alibaba/nacos/PigNacosApplication.java | 3 +- 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..21d40d87 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,49 @@ +# 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: PIG 构建action + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: mvn clean install + run: mvn clean install + + - name: mvn spring-javaformat:validate + run: mvn spring-javaformat:validate + + - name: success + if: ${{ success() }} + uses: fifsky/dingtalk-action@master + with: + url: ${{ secrets.DINGTALK_WEBHOOK}} + type: markdown + content: | + # 💯👨‍💻 Success 🎉🎉🎉 + > Github Action: https://github.com/pig-mesh/pig success + > ^_^ from github action message + + - name: failure + if: ${{ failure() }} + uses: fifsky/dingtalk-action@master + with: + url: ${{ secrets.DINGTALK_WEBHOOK}} + type: markdown + content: | + # 💤🤷‍♀️ failure 🙅‍♂️💣 + > Github Action: https://github.com/pig-mesh/pig failure + > (⋟﹏⋞) from github action message diff --git a/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/config/GatewaySwaggerAutoConfiguration.java b/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/config/GatewaySwaggerAutoConfiguration.java index 8d9e754c..7f0774c6 100644 --- a/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/config/GatewaySwaggerAutoConfiguration.java +++ b/pig-common/pig-common-swagger/src/main/java/com/pig4cloud/pig/common/swagger/config/GatewaySwaggerAutoConfiguration.java @@ -53,9 +53,9 @@ public class GatewaySwaggerAutoConfiguration { } else { // 关闭时,返回404 - return RouterFunctions - .route(RequestPredicates.GET("/swagger-ui/**").and(RequestPredicates.accept(MediaType.ALL)), - serverRequest -> ServerResponse.notFound().build()); + return RouterFunctions.route( + RequestPredicates.GET("/swagger-ui/**").and(RequestPredicates.accept(MediaType.ALL)), + serverRequest -> ServerResponse.notFound().build()); } } diff --git a/pig-register/src/main/java/com/alibaba/nacos/PigNacosApplication.java b/pig-register/src/main/java/com/alibaba/nacos/PigNacosApplication.java index 14f0c28b..782c98f3 100755 --- a/pig-register/src/main/java/com/alibaba/nacos/PigNacosApplication.java +++ b/pig-register/src/main/java/com/alibaba/nacos/PigNacosApplication.java @@ -46,8 +46,7 @@ public class PigNacosApplication { private static boolean initEnv() { // 特殊处理 window 且用户名包含中文的用户,避免RocksDB 初始化失败 // System.setProperty(SystemUtil.USER_HOME, "/nacos-path/"); - if (SystemUtil.getOsInfo().isWindows() - && Validator.hasChinese(SystemUtil.getUserInfo().getHomeDir())) { + if (SystemUtil.getOsInfo().isWindows() && Validator.hasChinese(SystemUtil.getUserInfo().getHomeDir())) { log.error("路径包含中文,需要打开以上注释配置指定不包含中文目录"); return false; }