Skip to content

Commit

Permalink
Merge pull request #423 from NipunaMadhushan/add-codecov
Browse files Browse the repository at this point in the history
Add jacoco codecov for build
  • Loading branch information
chanikag authored Oct 14, 2024
2 parents d40740d + e7f437a commit ed66586
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
37 changes: 7 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit ed66586

Please sign in to comment.