Skip to content

Commit f8d9676

Browse files
committed
chore: Adding coverage reports
1 parent 17cebbd commit f8d9676

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

.github/workflows/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ jobs:
4848
- name: Upload coverage to Codecov
4949
uses: codecov/[email protected]
5050
with:
51-
file: "${{ github.workspace }}/spi/target/jacoco.xml"
51+
file: "${{ github.workspace }}/*/target/site/jacoco/jacoco.xml"
5252
token: ${{ secrets.CODECOV_TOKEN }}
5353
fail_ci_if_error: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}

pom.xml

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,26 @@
110110
<maven-plugin-annotations.version>3.15.1</maven-plugin-annotations.version>
111111
<slf4j.version>2.0.16</slf4j.version>
112112
<logback.version>1.5.12</logback.version>
113+
<!-- versions of test dependencies -->
114+
<jacoco.version>0.8.12</jacoco.version>
113115
<jacoco.version>0.8.12</jacoco.version>
114116
<testng.version>7.10.2</testng.version>
115117
</properties>
116118

117119
<dependencyManagement>
118120
<dependencies>
121+
<!-- Project modules version -->
122+
<dependency>
123+
<groupId>net.continuous-security-tools</groupId>
124+
<artifactId>zap-utils</artifactId>
125+
<version>${project.version}</version>
126+
</dependency>
127+
<dependency>
128+
<groupId>net.continuous-security-tools</groupId>
129+
<artifactId>zap-client-api</artifactId>
130+
<version>${project.version}</version>
131+
</dependency>
132+
<!-- Dependencies -->
119133
<dependency>
120134
<groupId>org.jopendocument</groupId>
121135
<artifactId>jdom</artifactId>
@@ -176,18 +190,6 @@
176190
<artifactId>testng</artifactId>
177191
<version>${testng.version}</version>
178192
</dependency>
179-
180-
<!-- Project modules version -->
181-
<dependency>
182-
<groupId>net.continuous-security-tools</groupId>
183-
<artifactId>zap-utils</artifactId>
184-
<version>${project.version}</version>
185-
</dependency>
186-
<dependency>
187-
<groupId>net.continuous-security-tools</groupId>
188-
<artifactId>zap-client-api</artifactId>
189-
<version>${project.version}</version>
190-
</dependency>
191193
</dependencies>
192194
</dependencyManagement>
193195

@@ -243,6 +245,34 @@
243245
</configuration>
244246
</plugin>
245247

248+
<!-- Coverage metering -->
249+
<plugin>
250+
<groupId>org.jacoco</groupId>
251+
<artifactId>jacoco-maven-plugin</artifactId>
252+
<version>${jacoco.version}</version>
253+
<executions>
254+
<execution>
255+
<goals>
256+
<goal>prepare-agent</goal>
257+
</goals>
258+
<configuration>
259+
<propertyName>surefire.argLine</propertyName>
260+
</configuration>
261+
</execution>
262+
<!-- attached to Maven test phase -->
263+
<execution>
264+
<id>report</id>
265+
<phase>test</phase>
266+
<goals>
267+
<goal>report</goal>
268+
</goals>
269+
<configuration>
270+
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
271+
</configuration>
272+
</execution>
273+
</executions>
274+
</plugin>
275+
246276
<!-- Integration tests execution -->
247277
<plugin>
248278
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)