Skip to content

Commit a20633c

Browse files
CopilotGarciat
andauthored
Add Codecov coverage reporting to Maven workflow (#11)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
1 parent 5f90220 commit a20633c

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/maven.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ jobs:
1919
cache: maven
2020
- name: Build with Maven
2121
run: mvn clean verify package
22+
- name: Upload coverage to Codecov
23+
uses: codecov/codecov-action@v5
24+
with:
25+
token: ${{ secrets.CODECOV_TOKEN }}
26+
fail_ci_if_error: true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Type Class resolution for Java
22

3+
[![codecov](https://codecov.io/gh/Garciat/java-type-classes/branch/main/graph/badge.svg)](https://codecov.io/gh/Garciat/java-type-classes)
4+
35
See: https://garciat.com/posts/java-type-classes/
46

57
The core API of this library is:

pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,25 @@
8989
<artifactId>maven-surefire-plugin</artifactId>
9090
<version>3.5.4</version>
9191
</plugin>
92+
<plugin>
93+
<groupId>org.jacoco</groupId>
94+
<artifactId>jacoco-maven-plugin</artifactId>
95+
<version>0.8.12</version>
96+
<executions>
97+
<execution>
98+
<goals>
99+
<goal>prepare-agent</goal>
100+
</goals>
101+
</execution>
102+
<execution>
103+
<id>report</id>
104+
<phase>verify</phase>
105+
<goals>
106+
<goal>report</goal>
107+
</goals>
108+
</execution>
109+
</executions>
110+
</plugin>
92111
<plugin>
93112
<artifactId>maven-jar-plugin</artifactId>
94113
<version>3.5.0</version>
@@ -126,6 +145,10 @@
126145
<plugin>
127146
<artifactId>maven-compiler-plugin</artifactId>
128147
</plugin>
148+
<plugin>
149+
<groupId>org.jacoco</groupId>
150+
<artifactId>jacoco-maven-plugin</artifactId>
151+
</plugin>
129152
</plugins>
130153
</build>
131154
</project>

0 commit comments

Comments
 (0)