Skip to content

Report PR Test Coverage #2

Report PR Test Coverage

Report PR Test Coverage #2

name: Report PR Test Coverage
on:
workflow_run:
workflows:
- Tests CI
types:
- completed
permissions: { }
jobs:
publish:
name: Report Coverage
runs-on: ubuntu-latest
if: |-
github.event.workflow_run.event == 'pull_request'
&& github.event.workflow_run.conclusion == 'success'
steps:
- name: Download PR test coverage report
uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # tag=v4.1.3
with:
name: pr-test-coverage-report
run-id: ${{ github.event.workflow_run.id }}
- name: Report Coverage to Codacy
run: |-
bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
--organization-provider gh \
--username "${GITHUB_REPOSITORY_OWNER}" \
--project-name "${GITHUB_REPOSITORY##*/}" \
--project-token ${{ secrets.CODACY_PROJECT_TOKEN }} \
--commit-uuid "$(cat ./pr-commit.txt)" \
--coverage-reports ./jacoco.xml \
--language Java