Skip to content

Commit

Permalink
Also run linter during PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyLandman committed Sep 6, 2024
1 parent 5c9198a commit decd011
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ end_of_line = lf
[*.java]
indent_size = 4
max_line_length = 120


[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2
28 changes: 26 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@ jobs:
name: Event File
path: ${{ github.event_path }}


lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # run it on the PR, not on the merged commit, for better line numbers

- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Run checkstyle and print errors
run: mvn -B checkstyle:checkstyle checkstyle:check
- name: Report build results
uses: gmazzo/publish-report-annotations@v1 # target latest major
if: ${{ !cancelled() }}
with:
testsSummary: off
reports: "target/checkstyle-result.xml"



test:
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
strategy:
Expand All @@ -39,7 +63,7 @@ jobs:
java-version: 11
distribution: 'temurin'
cache: 'maven'

- name: test
run: mvn -B clean test

Expand All @@ -49,7 +73,7 @@ jobs:
with:
name: Unit Test Results (${{ matrix.os }})
path: target/surefire-reports/**/*.xml

checker-framework:
if: ${{ !(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[maven-release-plugin]')) }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit decd011

Please sign in to comment.