Skip to content

Commit c017931

Browse files
committed
using release version instead of building pmd from scratch
1 parent f9e3410 commit c017931

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

.github/workflows/pmd.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,35 @@ jobs:
1414
with:
1515
path: pr
1616

17-
- name: Clone PMD
18-
run: |
19-
sudo apt update -y
20-
sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev maven
21-
sudo apt install -y default-jdk
22-
git clone https://github.com/pmd/pmd.git pmd
23-
(cd pmd && git checkout)
17+
- name: Set up Java
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: '17'
2422

25-
- name: Build PMD
23+
- name: Run CPD for Fortran
24+
continue-on-error: true
25+
env:
26+
PMD_VERSION: 7.14.0
2627
run: |
27-
(cd pmd && ./mvnw clean install -DskipTests> ../pmd.txt)
28+
curl -sSL -o pmd.zip \
29+
"https://github.com/pmd/pmd/releases/download/pmd_releases/${PMD_VERSION}/pmd-dist-${PMD_VERSION}-bin.zip"
30+
unzip -q pmd.zip
31+
PMD_HOME="pmd-bin-${PMD_VERSION}"
32+
33+
"${PMD_HOME}/bin/pmd" cpd \
34+
--dir src \
35+
--language fortran \
36+
--minimum-tokens=10 \
37+
--fail-on-violation false \
38+
> ../pmd-fort.txt
2839

29-
- name: Running PMD
30-
run: |
31-
alias pmd="/pmd/bin/pmd"
32-
pmd cpd -l fortran pr/src/* > ../pmd-fort.txt
33-
pmd cpd -l python pr/toolchain/* > ../pmd-py.txt
40+
"${PMD_HOME}/bin/pmd" cpd \
41+
--dir toolchain \
42+
--language fortran \
43+
--minimum-tokens=10 \
44+
--fail-on-violation false \
45+
> ../pmd-py.txt
3446

3547
- name: Display PMD Reports
3648
run: |

0 commit comments

Comments
 (0)