Skip to content

Commit

Permalink
Merge pull request #31 from ShammiL/codecov-shammi
Browse files Browse the repository at this point in the history
Generate code coverage
  • Loading branch information
keizer619 authored Sep 18, 2024
2 parents 7c60192 + 58cbfb3 commit ea4a2ce
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/push_ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn clean install
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v4.0.1
with:
flags: unit_tests
token: ${{ secrets.CODECOV_TOKEN }}
51 changes: 51 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,60 @@
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<id>default-prepare-agent-by-coverage-enforcer</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>
<goals>
<goal>check</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>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<argLine>${argLine}</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down

0 comments on commit ea4a2ce

Please sign in to comment.