Skip to content

Commit 36fb29e

Browse files
author
mohdsaid497566
committed
comments removal 2
1 parent 7448609 commit 36fb29e

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

.github/workflows/pmd.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
name: PMD
1+
name: Source DRYness
22

33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
pmd:
7-
name: PMD Analysis
7+
name: PMD
88
runs-on: "ubuntu-latest"
99
env:
1010
pr_everything: 0
1111
steps:
1212
- name: Clone - PR
1313
uses: actions/checkout@v4
14-
with:
15-
path: pr
16-
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)
2414

25-
- name: Build PMD
26-
run: |
27-
(cd pmd && mvn clean install -DskipTests> ../pmd.txt)
15+
- name: Set up Java
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: '17'
2820

29-
- name: Running PMD
21+
- name: Run CPD for Fortran
22+
continue-on-error: true
3023
run: |
31-
alias pmd="$HOME/pmd/bin/pmd"
24+
# Get latest PMD version from GitHub API
25+
PMD_VERSION=$(curl -s https://api.github.com/repos/pmd/pmd/releases/latest | grep '"tag_name":' | cut -d'"' -f4 | sed 's/pmd_releases\///')
26+
echo "Using PMD version: $PMD_VERSION"
3227
33-
SOURCE_DIR="${1:-pr/src}"
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+
SOURCE_DIR="${1:-pr/src}"
3434
total_files=$(find "$SOURCE_DIR" -type f \( -name "*.f" -o -name "*.f90" -o -name "*.for" -o -name "*.fpp" -o -name "*.F" -o -name "*.F90" \) | wc -l)
3535
processed=0
3636

@@ -72,12 +72,8 @@ jobs:
7272
echo -e "Successfully processed $file"
7373
fi
7474
done
75-
pmd cpd -l fortran /* > ../pmd-fort.txt
76-
pmd cpd -l python pr/toolchain/* > ../pmd-py.txt
7775

78-
- name: Display PMD Reports
79-
run: |
80-
echo "PMD Fortran Report:"
81-
cat pmd-fort.txt
82-
echo "PMD Python Report:"
83-
cat pmd-py.txt
76+
"${PMD_HOME}/bin/pmd" cpd \
77+
--dir src \
78+
--language fortran \
79+
--minimum-tokens=40

0 commit comments

Comments
 (0)