Skip to content

Added jacoco plugin for showing code coverage info in a badge at the … #13

Added jacoco plugin for showing code coverage info in a badge at the …

Added jacoco plugin for showing code coverage info in a badge at the … #13

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
defaults:
run:
working-directory: ./products-service
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B verify --file pom.xml
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: '**/jacoco.csv'
- name: Commit the badge (if it changed)
run: |
if [[ `git status --porcelain` ]]; then
git config --global user.name 'Roland Speckmeier'
git config --global user.email '[email protected]'
git add '*.svg'
git commit -m "Autogenerated JaCoCo coverage badge"
git push
fi