Skip to content

Commit

Permalink
Merge pull request I-TECH-UW#1298 from mozzy11/develop
Browse files Browse the repository at this point in the history
Add Coverage Badge
  • Loading branch information
mozzy11 authored Nov 4, 2024
2 parents 6aaa083 + 0d6ac5a commit 633eb2e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@ jobs:
- name: Build OpenELIS-Global2
run: mvn clean install -Dspotless.check.skip=true

- name: Generate JaCoCo Badge
if: github.event_name == 'push'
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: target/site/jacoco/jacoco.csv
badges-directory: target/html/badges

- name: Publish coverage report to GitHub Pages
if: github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/html/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ You can find more information on how to set up OpenELIS at our
### CI Status

[![Maven Build Status](https://github.com/I-TECH-UW/OpenELIS-Global-2/actions/workflows/ci.yml/badge.svg)](https://github.com/I-TECH-UW/OpenELIS-Global-2/actions/workflows/ci.yml)
![Coverage](https://raw.githubusercontent.com/I-TECH-UW/OpenELIS-Global-2/refs/heads/gh-pages/badges/jacoco.svg)

[![Publish OpenELIS WebApp Docker Image Status](https://github.com/I-TECH-UW/OpenELIS-Global-2/actions/workflows/publish-and-test.yml/badge.svg)](https://github.com/I-TECH-UW/OpenELIS-Global-2/actions/workflows/publish-and-test.yml)

Expand Down
54 changes: 54 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,60 @@
</java>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<configuration>
<excludes>
<exclude>**/*.jar</exclude>
<exclude>naughty-dependency/**/*.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>

<!-- Make sure we have at least 70% coverage -->
<!-- <execution>
<id>verify-test-coverage</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<excludes>
<exclude>*Mojo</exclude>
</excludes>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>10%</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution> -->

</executions>
</plugin>



</plugins>
</build>
</project>

0 comments on commit 633eb2e

Please sign in to comment.