Update dependencies #1428
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: Coverage | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Checkout badges branch dedicated to storing badges only | |
uses: actions/checkout@v2 | |
with: | |
ref: badges | |
path: badges | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Build with Maven | |
run: mvn -B -q test -D'logging.level.edu.hawaii.its.groupings=OFF' -D'logging.level.edu.hawaii.its.api=OFF' -D'logging.level.org.springframework=ERROR' -D'spring.main.banner-mode=off' jacoco:report | |
- name: Generate Jacoco Badge | |
id: jacoco | |
uses: cicirello/jacoco-badge-generator@v2 | |
with: | |
badges-directory: badges | |
generate-branches-badge: false | |
- name: Log coverage percentage | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
- name: Commit and push | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
cd badges | |
if [[ `git status --porcelain *.svg` ]]; then | |
git config --global user.name 'Groupings Project' | |
git config --global user.email '[email protected]' | |
git add *.svg | |
git commit -m "Autogenerated JaCoCo coverage badge" *.svg | |
git push | |
fi | |
- name: Upload Jacoco coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco-report | |
path: target/site/jacoco/ |