Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code review bot workflow #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Code Review Bot

on:
pull_request:
branches: [ main ]

jobs:
code-review:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Checkstyle
run: ./gradlew checkstyleMain

- name: Run SpotBugs
run: ./gradlew spotbugsMain

- name: Install ReviewDog
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $HOME/bin
echo "$HOME/bin" >> $GITHUB_PATH

- name: Run Checkstyle with ReviewDog
run: |
./gradlew checkstyleMain | reviewdog -efm="%f:%l: %m" -name="Checkstyle" -reporter=github-pr-check -filter-mode=file

- name: Run SpotBugs with ReviewDog
run: |
./gradlew spotbugsMain | reviewdog -efm="%f:%l: %m" -name="SpotBugs" -reporter=github-pr-check -filter-mode=file