Add code style violation reporting to PRs #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Checkstyle | |
| on: | |
| pull_request: | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| checkstyle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run Checkstyle | |
| run: | | |
| ./gradlew checkstyleMain checkstyleTest | |
| - uses: reviewdog/[email protected] | |
| - name: Run reviewdog | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| find . -path "*/build/reports/checkstyle/*.xml" -type f | while read -r xmlReport; do | |
| cat "$xmlReport" | reviewdog \ | |
| -f=checkstyle \ | |
| -fail-level=any \ | |
| -reporter=github-pr-review \ | |
| || exit 1 | |
| done |