Skip to content

Commit

Permalink
chore: Adding coverage check
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Nov 5, 2024
1 parent 9bfa61d commit f229374
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ jobs:
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/target/*-reports/TEST-*.xml'

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: "${{ github.workspace }}/spi/target/jacoco.xml"
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
55 changes: 40 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@
</distributionManagement>

<properties>
<java.version>1.7</java.version>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
<surefire.argLine />

<!-- Maven plugins versions -->
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-javadoc-plugin.version>3.11.1</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-failsafe-plugin.version>3.5.0</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<maven-plugin-plugin.version>3.15.1</maven-plugin-plugin.version>
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
Expand All @@ -93,6 +95,8 @@
<maven-plugin-annotations.version>3.5</maven-plugin-annotations.version>
<slf4j.version>1.7.25</slf4j.version>
<logback.version>1.2.3</logback.version>
<!-- versions of test dependencies -->
<jacoco.version>0.8.12</jacoco.version>
<testng.version>6.9.10</testng.version>
</properties>

Expand Down Expand Up @@ -168,6 +172,33 @@
</execution>
</executions>
</plugin>
<!-- Coverage metering -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>surefire.argLine</propertyName>
</configuration>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<!-- Integration tests execution -->
<plugin>
Expand Down Expand Up @@ -201,21 +232,15 @@
</pluginManagement>
<plugins>
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>${maven-plugin.gitflow.version}</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<gitFlowConfig>
<productionBranch>master</productionBranch>
<developmentBranch>develop</developmentBranch>
<featureBranchPrefix>feature/</featureBranchPrefix>
<releaseBranchPrefix>release/</releaseBranchPrefix>
<hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
<supportBranchPrefix>support/</supportBranchPrefix>
<origin>origin</origin>
</gitFlowConfig>
<keepBranch>false</keepBranch>
<pushReleases>true</pushReleases>
<threadCount>1</threadCount>
<perCoreThreadCount>false</perCoreThreadCount>
<argLine>
@{surefire.argLine} --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit f229374

Please sign in to comment.