Files
Ornot/.gitea/workflows/linting.yml
Josh Chester 6e804af93c
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
Java Google Checkstyle / Checkstyle Linter (pull_request) Failing after 17s
lint on pull request
2026-01-23 22:46:25 -06:00

52 lines
1.5 KiB
YAML

name: Java Google Checkstyle
permissions:
contents: read
pull-request: write
on: [pull_request]
jobs:
checkstyle:
name: 'Checkstyle Linter'
runs-on: ubuntu-latest
env:
CHECKSTYLE_VERSION: '10.25.0'
REVIEWDOG_VERSION: latest
REVIEWDOG_GITEA_API_TOKEN: cce3e487b7da8f6a98168a066dc5347b7a61f12e
GITEA_ADDRESS: http://gitea:3000
steps:
- name: 'Pull code'
uses: actions/checkout@v6
- name: 'Find changed Java files'
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**.java
- name: 'Setup Java JDK'
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'zulu'
- name: 'Setup Reviewdog'
uses: reviewdog/action-setup@v1
with:
reviewdog_version: ${{ env.REVIEWDOG_VERSION }}
- name: 'Run Checkstyle with Reviewdog'
if: steps.changed-files.outputs.any_changed == 'true'
run: |
wget wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${{ env.CHECKSTYLE_VERSION }}/checkstyle-${{ env.CHECKSTYLE_VERSION }}-all.jar
echo "${{ steps.changed-files.outputs.all_changed_files }}"
java -jar checkstyle-${{ env.CHECKSTYLE_VERSION }}-all.jar -c google_checks.xml -f xml ${{ steps.changed-files.outputs.all_changed_files }} \
| reviewdog -f=checkstyle \
-name="Checkstyle" \
-reporter="gitea-pr-review" \
-level="warning" \
-fail-on-error="true"