Autogenerated JaCoCo coverage badge #102
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push] | |
jobs: | |
build_job: # job name | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Use JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
# here the actual build starts | |
- name: Standard Checkout | |
uses: actions/[email protected] | |
- name: Build with Maven | |
run: mvn -B verify | |
- name: Generate JaCoCo Badge | |
if: github.ref == 'refs/heads/develop' | |
id: jacoco | |
uses: cicirello/[email protected] | |
with: | |
jacoco-csv-file: aggregate-report/target/site/jacoco-aggregate/jacoco.csv | |
generate-branches-badge: true | |
- name: Log coverage percentage | |
if: github.ref == 'refs/heads/develop' | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | |
- name: Commit and push the badge (if it changed) | |
if: github.ref == 'refs/heads/develop' | |
uses: EndBug/[email protected] | |
with: | |
default_author: github_actions | |
message: 'Autogenerated JaCoCo coverage badge' | |
add: '*.svg' |