diff --git a/.github/workflows/CI-CD.yml b/.github/workflows/CI-CD.yml index 4903a56..b35ff0f 100644 --- a/.github/workflows/CI-CD.yml +++ b/.github/workflows/CI-CD.yml @@ -88,6 +88,30 @@ jobs: run: | echo "Running the tests" ./mvnw test + - name: JaCoCo Code Coverage Report + id: jacoco_reporter + uses: PavanMudigonda/jacoco-reporter@v4.9 + with: + coverage_results_path: jacoco-report/test.xml + coverage_report_name: Coverage + coverage_report_title: JaCoCo + github_token: ${{ secrets.GITHUB_TOKEN }} + skip_check_run: false + minimum_coverage: 80 + fail_below_threshold: false + publish_only_summary: false + + # Publish Coverage Job Summary # Optional + - name: Add Coverage Job Summary + run: echo "${{ steps.jacoco_reporter.outputs.coverageSummary }}" >> $GITHUB_STEP_SUMMARY + + # uploads the coverage-report.md artifact # Optional + - name: Upload Code Coverage Artifacts + uses: actions/upload-artifact@v2 + with: + name: code-coverage-report-markdown + path: */coverage-results.md + retention-days: 1 build-image-push: runs-on: ubuntu-latest needs: [prepare, build-and-test]