This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
Update README.md #3
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: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
- name: Build with Maven | |
run: mvn -B test | |
- name: Generate JaCoCo Badge | |
id: jacoco | |
uses: cicirello/[email protected] | |
- name: Log coverage percentage | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | |
- name: Commit the badge (if it changed) | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name 'sfuhrm' | |
git config --global user.email '[email protected]' | |
git add -A | |
git commit -m "Autogenerated JaCoCo coverage badge" | |
git push | |
fi | |
- name: Upload JaCoCo coverage report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jacoco-report | |
path: target/site/jacoco/ |