Skip to content

Commit

Permalink
Merge pull request #582 from wso2-extensions/add-codecov
Browse files Browse the repository at this point in the history
[Automated PR]Add Codecov and JaCoCo configurations
  • Loading branch information
UdeshAthukorala authored Nov 26, 2024
2 parents 4476788 + 95c7dda commit a12bd25
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 13 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ jobs:
- name: Build with Maven
run: mvn clean install -U -B

- name: Generate coverage report
run: mvn test jacoco:report

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files : target/site/jacoco/jacoco.xml
16 changes: 16 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes
coverage:
status:
project:
default:
enabled: yes
threshold: null
target: auto
patch:
default:
target: 80%
threshold: 40%
36 changes: 24 additions & 12 deletions components/org.wso2.carbon.identity.scim2.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -306,18 +311,6 @@
</excludes>
</configuration>
<executions>
<execution>
<id>default-instrument</id>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>default-restore-instrumented-classes</id>
<goals>
<goal>restore-instrumented-classes</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
Expand Down Expand Up @@ -360,6 +353,25 @@
<threshold>High</threshold>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
24 changes: 24 additions & 0 deletions components/org.wso2.carbon.identity.scim2.provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
<artifactId>org.wso2.carbon.identity.recovery</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -124,6 +129,25 @@
<threshold>Medium</threshold>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
24 changes: 24 additions & 0 deletions features/org.wso2.carbon.identity.scim2.common.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<groupId>org.wso2.charon</groupId>
<artifactId>org.wso2.charon3.core</artifactId>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -130,6 +135,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
24 changes: 24 additions & 0 deletions features/org.wso2.carbon.identity.scim2.provider.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<artifactId>org.wso2.carbon.identity.scim2.provider</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -146,6 +151,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
24 changes: 24 additions & 0 deletions features/org.wso2.carbon.identity.scim2.server.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<artifactId>org.wso2.carbon.identity.scim2.provider.feature</artifactId>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -78,6 +83,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
52 changes: 51 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@
<artifactId>pax-logging-api</artifactId>
<version>${pax.logging.api.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -340,6 +350,8 @@
<spotbugs-maven-plugin.version>4.5.3.0</spotbugs-maven-plugin.version>

<jaxp-ri-version>1.4.5</jaxp-ri-version>

<jacoco.version>0.8.12</jacoco.version>
</properties>

<build>
Expand Down Expand Up @@ -388,7 +400,7 @@
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>${findsecbugs-plugin.version}</version>
</plugin>
</plugin>
</plugins>
</configuration>
<executions>
Expand All @@ -401,6 +413,44 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

Expand Down

0 comments on commit a12bd25

Please sign in to comment.