diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..549d67f --- /dev/null +++ b/.github/workflows/check.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f03dff0..c421a9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: - arguments: api:build + arguments: api:build -x checkstyleMain -x checkstyleTest - name: Release-mac uses: softprops/action-gh-release@v1 diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 37e5f67..300668e 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -16,13 +16,14 @@ - + - + diff --git a/plugin/src/test/java/App.java b/plugin/src/test/java/App.java index e8d45da..2c0452a 100644 --- a/plugin/src/test/java/App.java +++ b/plugin/src/test/java/App.java @@ -33,7 +33,8 @@ public class App { // this config is used by mysql 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); } }