From 2d0fa4db3977c5c07054bca6640dba5df5d4269c Mon Sep 17 00:00:00 2001 From: Stephan Fuhrmann Date: Mon, 8 Jan 2024 23:30:55 +0100 Subject: [PATCH] Add jacoco workflow Update jacoco version --- .github/workflows/jacoco-badge.yml | 46 ++++++++++++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/jacoco-badge.yml diff --git a/.github/workflows/jacoco-badge.yml b/.github/workflows/jacoco-badge.yml new file mode 100644 index 00000000..079db4a1 --- /dev/null +++ b/.github/workflows/jacoco-badge.yml @@ -0,0 +1,46 @@ +name: Coverage + +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 21 + + - name: Build with Maven + run: mvn -B test + + - name: Generate JaCoCo Badge + id: jacoco + uses: cicirello/jacoco-badge-generator@v2.0.1 + with: + jacoco-csv-file: radiobrowser4j/target/site/jacoco/jacoco.csv + + - name: Log coverage percentage + run: | + echo "coverage = ${{ steps.jacoco.outputs.coverage }}" + echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" + + - uses: casperdcl/push-dir@v1 + with: + message: update static site + branch: gh-pages + dir: .github/badges + history: false + nojekyll: true + + - name: Upload JaCoCo coverage report + uses: actions/upload-artifact@v3 + with: + name: jacoco-report + path: target/site/jacoco/ diff --git a/pom.xml b/pom.xml index 8f10049e..350cd485 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.11