Skip to content

Commit

Permalink
Merge pull request #50 from asgardeo/add-codecov-configs
Browse files Browse the repository at this point in the history
Add Codecov and JaCoCo configurations
  • Loading branch information
asekawa authored Aug 16, 2024
2 parents 53198ef + bf43f90 commit fb6507d
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
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%
24 changes: 24 additions & 0 deletions io.asgardeo.tomcat.oidc.agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -59,6 +64,25 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</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>
24 changes: 24 additions & 0 deletions io.asgardeo.tomcat.oidc.sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<groupId>io.asgardeo.tomcat.oidc.agent</groupId>
<artifactId>io.asgardeo.tomcat.oidc.agent</artifactId>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -80,6 +85,25 @@
<artifactId>maven-clean-plugin</artifactId>
<version>2.1</version>
</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>
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
<artifactId>xercesImpl</artifactId>
<version>${xerces.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -87,6 +92,25 @@
<doUpdate>false</doUpdate>
</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>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -124,5 +148,7 @@
<io.asgardeo.java.oidc.sdk.version>0.1.24</io.asgardeo.java.oidc.sdk.version>
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>
<xerces.version>2.11.0</xerces.version>

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

0 comments on commit fb6507d

Please sign in to comment.