Skip to content

Commit

Permalink
Add jacoco workflow
Browse files Browse the repository at this point in the history
Update jacoco version
  • Loading branch information
sfuhrm committed Jan 8, 2024
1 parent 7397434 commit 2d0fa4d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/jacoco-badge.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.11</version>
<executions>
<execution>
<goals>
Expand Down

0 comments on commit 2d0fa4d

Please sign in to comment.