@@ -3,19 +3,54 @@ name: PMD Analysis
33on : [push, pull_request, workflow_dispatch]
44
55jobs :
6- pmd :
7- runs-on : ubuntu-latest
6+ file-changes :
7+ name : Detect File Changes
8+ runs-on : ' ubuntu-latest'
9+ outputs :
10+ checkall : ${{ steps.changes.outputs.checkall }}
811 steps :
9- - uses : actions/checkout@v2
10- - uses : actions/setup-java@v4
11- with :
12- distribution : ' temurin'
13- java-version : ' 11'
14- - uses : pmd/pmd-github-action@v2
15- id : pmd
16- with :
17- rulesets : ' .github/workflows/ruleset.xml'
18- analyzeModifiedFilesOnly : true
19- createGitHubAnnotations : false
20- uploadSarifReport : true
12+ - name : Clone
13+ uses : actions/checkout@v4
14+
15+ - name : Detect Changes
16+ uses : dorny/paths-filter@v3
17+ id : changes
18+ with :
19+ filters : " .github/file-filter.yml"
20+
21+ pmd :
22+ name : PMD Analysis
23+ if : needs.file-changes.outputs.checkall == 'true'
24+ needs : file-changes
25+ runs-on : " ubuntu-latest"
26+ env :
27+ pr_everything : 0
28+ steps :
29+ - name : Clone - PR
30+ uses : actions/checkout@v4
31+ with :
32+ path : pr
33+
34+ - name : Clone PMD
35+ run : |
36+ sudo apt update -y
37+ sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
38+ git clone https://github.com/pmd/pmd.git pmd
39+ (cd pmd && git checkout pmd)
40+
41+ - name : Build PMD
42+ run : |
43+ (cd pmd && ./mvnw clean install -DskipTests> ../pmd.txt)
44+
45+ - name : Running PMD
46+ run : |
47+ (cd pmd && ./pmd cpd -l fortran pr/src/* > ../pmd-fort.txt)
48+ (cd pmd && ./pmd cpd -l python pr/toolchain/* > ../pmd-py.txt)
2149
50+ - name : Display PMD Reports
51+ uses : actions/upload-artifact@v2
52+ with :
53+ name : pmd-reports
54+ path : |
55+ pmd-fort.txt
56+ pmd-py.txt
0 commit comments