Skip to content

Commit

Permalink
Add jacoco codecov for build
Browse files Browse the repository at this point in the history
NipunaMadhushan committed Sep 27, 2024
1 parent 7eabfe9 commit e7f437a
Showing 2 changed files with 28 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -52,6 +52,27 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jacoco</outputDirectory>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
<includes>
<include>**/*.class</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
37 changes: 7 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -238,44 +238,21 @@
<version>0.8.4</version>
<executions>
<execution>
<id>default-prepare-agent-by-coverage-enforcer</id>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>argLine</propertyName>
</configuration>
</execution>
<execution>
<id>default-report-by-coverage-enforcer</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
</configuration>
</execution>
<execution>
<id>default-check-by-coverage-enforcer</id>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
<goal>report-aggregate</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
<rules>
<!-- implementation is needed only for Maven 2 -->
<rule implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits>
<!-- implementation is needed only for Maven 2 -->
<limit implementation="org.jacoco.report.check.Limit">
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
</rules>
<includes>
<include>**/*.class</include>
</includes>
</configuration>
</execution>
</executions>

0 comments on commit e7f437a

Please sign in to comment.