Skip to content

Commit

Permalink
task#64: add code coverage with jacoco in action pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementGib committed Oct 27, 2024
1 parent 77694f9 commit 3294afd
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/maven.yml → .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
Expand All @@ -30,3 +29,27 @@ jobs:
cache: maven
- name: Build with Maven and tests
run: mvn -B package --file pom.xml
- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: >
domain/target/site/jacoco/jacoco.csv
application/target/site/jacoco/jacoco.csv
client/target/site/jacoco/jacoco.csv
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Commit the badge (if it changed)
run: |
if [[ `git status --porcelain` ]]; then
git config --global user.name 'YOUR NAME HERE'
git config --global user.email '[email protected]'
git add -A
git commit -m "Autogenerated JaCoCo coverage badge"
git push
fi
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

# Bank Account Quarkus 🏦 ![image](https://github.com/ClementGib/BankAccountQuarkus/assets/50382080/43b59c95-1778-4d52-bb65-7697e20c8298)
# Bank Account Quarkus ![image](https://github.com/ClementGib/BankAccountQuarkus/assets/50382080/43b59c95-1778-4d52-bb65-7697e20c8298)

<!-- README.md -->

## About
| **Project info** | ![java](https://img.shields.io/badge/Java-100%25-red) ![Static Badge](https://img.shields.io/badge/Framework-Quarkus-blue) [![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/ClementGib/BankAccountQuarkus/blob/develop/LICENSE)|
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Build Status** | [![build](https://github.com/ClementGib/BankAccountQuarkus/jacoco-badge-generator/actions/workflows/workflow.yml/badge.svg)](https://github.com/ClementGib/BankAccountQuarkus/jacoco-badge-generator/actions/workflows/workflow.yml) |

# Sommaire
1. [Directives](#Directives-)
2. [Solution](#Solution-)
![Uploading image.png…]()



Expand Down
35 changes: 25 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,32 @@
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<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>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
</profile>
</profiles>
</project>

0 comments on commit 3294afd

Please sign in to comment.