Skip to content

pr-display-code-coverage #3206

pr-display-code-coverage

pr-display-code-coverage #3206

name: pr-display-code-coverage
on:
workflow_run:
workflows: [pytest]
types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
pr-display-code-coverage:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
package: ["skore", "skore-hub-project", "skore-local-project"]
permissions:
actions: read
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
sparse-checkout: .github
- name: Download coverage reports
id: download-coverage-reports
continue-on-error: True
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: ${{ matrix.package }}-coverage
path: coverage/
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Acquire PR context
if: ${{ steps.download-coverage-reports.outcome == 'success' }}
id: acquire-pr-context
uses: ./.github/actions/workflow-run/context
- name: Display coverage reports
if: ${{ steps.download-coverage-reports.outcome == 'success' }}
uses: MishaKav/pytest-coverage-comment@ae0e8a539a3f310aefb3bfb6a2209778a21fa42b # v1.2.0
with:
issue-number: ${{ steps.acquire-pr-context.outputs.pr-number }}
pytest-xml-coverage-path: coverage/pytest-coverage.xml
junitxml-path: coverage/pytest.xml
title: Coverage Report for `${{ matrix.package }}/`
unique-id-for-comment: ${{ matrix.package }}