display backend coverage in PR #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: display backend coverage in PR | |
on: | |
workflow_run: | |
workflows: [backend] | |
types: [completed] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
display-backend-coverage: | |
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Acquire PR context | |
id: acquire-pr-context | |
uses: ./.github/actions/workflow-run/context | |
- name: Download coverage reports | |
uses: actions/download-artifact@v4 | |
with: | |
name: backend-coverage | |
path: coverage/ | |
github-token: ${{ github.token }} | |
run-id: ${{ github.event.workflow_run.id }} | |
- name: Display coverage reports | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
issue-number: ${{ steps.acquire-pr-context.outputs.pr-number }} | |
pytest-coverage-path: coverage/coverage.txt | |
junitxml-path: coverage/coverage.xml | |
title: Coverage Report for backend |