👷 Adding CI build system. 格式化代码

This commit is contained in:
lbw 2021-04-16 11:47:36 +08:00
parent 8626f087bb
commit 69e9c9db76
3 changed files with 53 additions and 5 deletions

49
.github/workflows/maven.yml vendored Normal file
View File

@ -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

View File

@ -53,8 +53,8 @@ public class GatewaySwaggerAutoConfiguration {
}
else {
// 关闭时返回404
return RouterFunctions
.route(RequestPredicates.GET("/swagger-ui/**").and(RequestPredicates.accept(MediaType.ALL)),
return RouterFunctions.route(
RequestPredicates.GET("/swagger-ui/**").and(RequestPredicates.accept(MediaType.ALL)),
serverRequest -> ServerResponse.notFound().build());
}
}

View File

@ -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;
}