Skip to content

Commit

Permalink
Merge pull request #59 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
asekawa authored Nov 27, 2024
2 parents e38b39f + f46f1bc commit e4fe5a7
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,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%
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@
<artifactId>org.jacoco.agent</artifactId>
<classifier>runtime</classifier>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -213,6 +218,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>
</project>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<groupId>org.wso2.carbon.identity.local.auth.magiclink</groupId>
<artifactId>org.wso2.carbon.identity.application.authenticator.magiclink</artifactId>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -64,6 +69,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
71 changes: 70 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@
<classifier>runtime</classifier>
<version>${jacoco.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>
<build>
Expand Down Expand Up @@ -182,6 +192,44 @@
</instructions>
</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>
<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>
<plugins>
Expand Down Expand Up @@ -210,7 +258,26 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
</plugin>
</plugins>
<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>

<properties>
Expand Down Expand Up @@ -252,6 +319,8 @@
<findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
<maven.bundle.plugin.version>3.2.0</maven.bundle.plugin.version>
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>

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

0 comments on commit e4fe5a7

Please sign in to comment.