diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d001bcf4b4..2f6e116231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/ diff --git a/README.md b/README.md index 61e5f09e2c..d1e0bdc035 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/pom.xml b/pom.xml index 7582194274..6af06f581c 100644 --- a/pom.xml +++ b/pom.xml @@ -722,6 +722,60 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + **/*.jar + naughty-dependency/**/*.class + + + + + + prepare-agent + + + + report + test + + report + + + + + + + + + + +