Skip to content

Commit 11c6f7e

Browse files
committed
Add pmd to check-build workflow
1 parent f5240c0 commit 11c6f7e

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

.github/workflows/check-build.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
7171
if-no-files-found: error
7272

73-
code-style:
73+
checkstyle:
7474
runs-on: ubuntu-latest
7575
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
7676

@@ -91,3 +91,40 @@ jobs:
9191

9292
- name: Run Checkstyle
9393
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
94+
95+
pmd:
96+
runs-on: ubuntu-latest
97+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
98+
99+
strategy:
100+
matrix:
101+
java: [17]
102+
distribution: [temurin]
103+
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- name: Set up JDK
108+
uses: actions/setup-java@v4
109+
with:
110+
distribution: ${{ matrix.distribution }}
111+
java-version: ${{ matrix.java }}
112+
cache: 'maven'
113+
114+
- name: Run PMD
115+
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
116+
117+
- name: Run CPD (Copy Paste Detector)
118+
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
119+
120+
- name: Upload report
121+
if: always()
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: pmd-report
125+
if-no-files-found: ignore
126+
path: |
127+
target/site/*.html
128+
target/site/css/**
129+
target/site/images/logos/maven-feather.png
130+
target/site/images/external.png

0 commit comments

Comments
 (0)