diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 566795c2..b93f9253 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -43,6 +43,21 @@ jobs: - name: Log coverage percentage run: | - echo "GitHub User ID: ${GITHUB_ACTOR}" echo "coverage = ${{ steps.jacoco.outputs.coverage }}" - echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" \ No newline at end of file + 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 'ClementGib' + git config --global user.email 'ClementGib@users.noreply.github.com' + 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/ \ No newline at end of file