feat: add checkstyle action
This commit is contained in:
parent
2fc5f70db1
commit
406109f941
|
@ -0,0 +1,18 @@
|
||||||
|
name: check
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkstyle:
|
||||||
|
name: Checkstyle
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: reviewdog/action-setup@v1
|
||||||
|
with:
|
||||||
|
reviewdog_version: latest
|
||||||
|
- name: download checkstyle
|
||||||
|
run: curl -o checkstyle.jar -L https://github.com/checkstyle/checkstyle/releases/download/checkstyle-9.3/checkstyle-9.3-all.jar
|
||||||
|
- name: checkstyle
|
||||||
|
env:
|
||||||
|
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: java -jar checkstyle.jar -c config/checkstyle/checkstyle.xml -f xml . | reviewdog -f=checkstyle -name="Checkstyle Report" -reporter="github-check" -fail-on-error=true -level="error" -filter-mode=nofilter
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||||
with:
|
with:
|
||||||
arguments: api:build
|
arguments: api:build -x checkstyleMain -x checkstyleTest
|
||||||
|
|
||||||
- name: Release-mac
|
- name: Release-mac
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
@ -16,13 +16,14 @@
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
<property name="charset" value="UTF-8"/>
|
<property name="charset" value="UTF-8"/>
|
||||||
|
|
||||||
<property name="severity" value="warning"/>
|
<property name="severity" value="error"/>
|
||||||
|
|
||||||
<property name="fileExtensions" value="java, properties, xml"/>
|
<property name="fileExtensions" value="java, properties, xml"/>
|
||||||
<!-- Excludes all 'module-info.java' files -->
|
<!-- Excludes all 'module-info.java' files -->
|
||||||
<!-- See https://checkstyle.org/config_filefilters.html -->
|
<!-- See https://checkstyle.org/config_filefilters.html -->
|
||||||
<module name="BeforeExecutionExclusionFileFilter">
|
<module name="BeforeExecutionExclusionFileFilter">
|
||||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
<property name="fileNamePattern"
|
||||||
|
value=".*[\\/]generated-src[\\/]jooq[\\/].*$"/>
|
||||||
</module>
|
</module>
|
||||||
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
|
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
|
||||||
<module name="SuppressionFilter">
|
<module name="SuppressionFilter">
|
||||||
|
|
|
@ -33,7 +33,8 @@ public class App {
|
||||||
// this config is used by mysql
|
// this config is used by mysql
|
||||||
info.put("useInformationSchema", "true");
|
info.put("useInformationSchema", "true");
|
||||||
|
|
||||||
String url = "jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true";
|
String url = "jdbc:mysql://localhost:3306/demo?"
|
||||||
|
+ "useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true";
|
||||||
return DriverManager.getConnection(url, info);
|
return DriverManager.getConnection(url, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue