1
1
name : ' Quality Monitor PR'
2
2
3
3
on :
4
- pull_request_target :
4
+ pull_request :
5
5
6
6
jobs :
7
7
build :
11
11
12
12
steps :
13
13
- uses : actions/checkout@v4
14
- with :
15
- ref : " refs/pull/${{ github.event.number }}/merge"
16
14
- name : Set up JDK 21
17
15
uses : actions/setup-java@v4
18
16
with :
@@ -24,29 +22,36 @@ jobs:
24
22
uses : stCarolas/setup-maven@v5
25
23
with :
26
24
maven-version : 3.9.9
25
+ - name : Cache the NVD database
26
+ uses : actions/cache@v4
27
+ with :
28
+ path : ~/.m2/repository/org/owasp/dependency-check-data
29
+ key : dependency-check
27
30
- name : Build with Maven
28
31
env :
29
32
BROWSER : chrome-container
30
- run : mvn -V --color always -ntp clean verify -Ppit -Pci | tee maven.log
33
+ NVD_API_KEY : ${{ secrets.NVD_API_KEY }}
34
+ run : mvn -V --color always -ntp clean verify -Ppit -Pci -Powasp | tee maven.log
31
35
- name : Extract pull request number
32
36
uses : jwalton/gh-find-current-pr@v1
33
37
id : pr
34
38
- name : Run Quality Monitor
35
- uses : uhafner/quality-monitor@v1
39
+ uses : uhafner/quality-monitor@v2
36
40
with :
37
41
github-token : ${{ secrets.GITHUB_TOKEN }}
38
42
pr-number : ${{ steps.pr.outputs.number }}
43
+ show-headers : true
39
44
config : >
40
45
{
41
46
"tests": {
47
+ "name": "Tests",
42
48
"tools": [
43
49
{
44
- "id": "test ",
45
- "name": "Tests",
50
+ "id": "junit ",
51
+ "name": "JUnit Tests",
46
52
"pattern": "**/target/*-reports/TEST*.xml"
47
53
}
48
- ],
49
- "name": "Tests"
54
+ ]
50
55
},
51
56
"analysis": [
52
57
{
72
77
"id": "spotbugs",
73
78
"sourcePath": "src/main/java",
74
79
"pattern": "**/target/spotbugsXml.xml"
80
+ },
81
+ {
82
+ "id": "error-prone",
83
+ "pattern": "**/maven.log"
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "name": "API Problems",
89
+ "id": "api",
90
+ "icon": "no_entry_sign",
91
+ "tools": [
92
+ {
93
+ "id": "revapi",
94
+ "sourcePath": "src/main/java",
95
+ "pattern": "**/target/revapi-result.json"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "name": "Vulnerabilities",
101
+ "id": "vulnerabilities",
102
+ "icon": "shield",
103
+ "tools": [
104
+ {
105
+ "id": "owasp-dependency-check",
106
+ "pattern": "**/target/dependency-check-report.json"
75
107
}
76
108
]
77
109
}
@@ -82,90 +114,74 @@ jobs:
82
114
"tools": [
83
115
{
84
116
"id": "jacoco",
85
- "name": "Line Coverage",
86
117
"metric": "line",
87
118
"sourcePath": "src/main/java",
88
119
"pattern": "**/target/site/jacoco/jacoco.xml"
89
120
},
90
121
{
91
122
"id": "jacoco",
92
- "name": "Branch Coverage",
93
123
"metric": "branch",
94
124
"sourcePath": "src/main/java",
95
125
"pattern": "**/target/site/jacoco/jacoco.xml"
96
126
}
97
127
]
128
+ },
129
+ {
130
+ "name": "Mutation Coverage",
131
+ "tools": [
132
+ {
133
+ "id": "pit",
134
+ "metric": "mutation",
135
+ "sourcePath": "src/main/java",
136
+ "pattern": "**/target/pit-reports/mutations.xml"
137
+ },
138
+ {
139
+ "id": "pit",
140
+ "metric": "test-strength",
141
+ "sourcePath": "src/main/java",
142
+ "pattern": "**/target/pit-reports/mutations.xml"
143
+ }
144
+ ]
98
145
}
99
146
],
100
147
"metrics":
101
148
{
102
- "name": "Toplevel Metrics",
149
+ "name": "Software Metrics",
103
150
"tools": [
104
151
{
105
- "name": "Cyclomatic Complexity",
106
152
"id": "metrics",
107
153
"pattern": "**/metrics/pmd.xml",
108
154
"metric": "CYCLOMATIC_COMPLEXITY"
109
155
},
110
156
{
111
- "name": "Cognitive Complexity",
112
157
"id": "metrics",
113
158
"pattern": "**/metrics/pmd.xml",
114
159
"metric": "COGNITIVE_COMPLEXITY"
115
160
},
116
161
{
117
- "name": "Lines of Code",
118
162
"id": "metrics",
119
163
"pattern": "**/metrics/pmd.xml",
120
- "metric": "LOC "
164
+ "metric": "NPATH_COMPLEXITY "
121
165
},
122
166
{
123
- "name": "Non Commenting Source Statements",
124
167
"id": "metrics",
125
168
"pattern": "**/metrics/pmd.xml",
126
- "metric": "NCSS "
169
+ "metric": "LOC "
127
170
},
128
171
{
129
- "name": "Access to foreign data",
130
172
"id": "metrics",
131
173
"pattern": "**/metrics/pmd.xml",
132
- "metric": "ACCESS_TO_FOREIGN_DATA "
174
+ "metric": "NCSS "
133
175
},
134
176
{
135
- "name": "Class cohesion",
136
177
"id": "metrics",
137
178
"pattern": "**/metrics/pmd.xml",
138
179
"metric": "COHESION"
139
180
},
140
181
{
141
- "name": "Fan out",
142
- "id": "metrics",
143
- "pattern": "**/metrics/pmd.xml",
144
- "metric": "FAN_OUT"
145
- },
146
- {
147
- "name": "Number of accessors",
148
- "id": "metrics",
149
- "pattern": "**/metrics/pmd.xml",
150
- "metric": "NUMBER_OF_ACCESSORS"
151
- },
152
- {
153
- "name": "Weight of a class",
154
182
"id": "metrics",
155
183
"pattern": "**/metrics/pmd.xml",
156
184
"metric": "WEIGHT_OF_CLASS"
157
- },
158
- {
159
- "name": "Weighted method count",
160
- "id": "metrics",
161
- "pattern": "**/metrics/pmd.xml",
162
- "metric": "WEIGHED_METHOD_COUNT"
163
- },
164
- {
165
- "name": "N-Path Complexity",
166
- "id": "metrics",
167
- "pattern": "**/metrics/pmd.xml",
168
- "metric": "NPATH_COMPLEXITY"
169
185
}
170
186
]
171
187
}
0 commit comments