diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 025f6ed9..0daedceb 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -11,12 +11,14 @@ name: Code coverage on: push: branches: [ "master" ] + pull_request: jobs: codecov: permissions: checks: write contents: read + pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -41,14 +43,23 @@ jobs: if: success() || failure() # always run even if the previous step fails with: report_paths: '**/target/failsafe-reports/TEST-*.xml' - - name: Publish test coverage results - uses: PavanMudigonda/jacoco-reporter@v4.8 + - name: Add coverage to PR + id: jacoco + uses: madrapps/jacoco-report@v1.6.1 with: - coverage_results_path: 'target/site/jacoco/jacoco.xml' - coverage_report_title: 'Test coverage results' - coverage_report_name: 'Test coverage results' + paths: | + ${{ github.workspace }}/**/target/site/jacoco/jacoco.xml + token: ${{ secrets.GITHUB_TOKEN }} + min-coverage-overall: 40 + min-coverage-changed-files: 60 - name: Upload Code Coverage Artifacts uses: actions/upload-artifact@v2 + if: success() || failure() # always run even if the previous step fails with: - name: code-coverage-report-markdown - path: '*/coverage-results.md' + name: code-coverage-reports + path: ${{ github.workspace }}/**/target/site/jacoco + + - name: Get the Coverage info + run: | + echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}" + echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"