Merge pull request #72 from DARC-e-V/fix/remove-pytest-coverage-comments
fix: use different method to comment test report
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
name: Pytest Report
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [Pytest]
|
||||||
|
types: [completed]
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
jobs:
|
||||||
|
checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download Test Report
|
||||||
|
uses: actions/download-artifact@v7
|
||||||
|
with:
|
||||||
|
name: pytest-report
|
||||||
|
run-id: ${{ github.event.workflow_run.id }}
|
||||||
|
- name: Publish Test Report
|
||||||
|
uses: mikepenz/action-junit-report@v6
|
||||||
|
with:
|
||||||
|
commit: ${{github.event.workflow_run.head_sha}}
|
||||||
|
report_paths: pytest.xml
|
||||||
|
comment: true
|
||||||
|
pr_id: ${{ github.event.workflow_run.pull_requests[0].number }}
|
||||||
@@ -2,8 +2,6 @@ name: Pytest
|
|||||||
on: pull_request
|
on: pull_request
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
checks: write
|
|
||||||
pull-requests: write
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -21,12 +19,10 @@ jobs:
|
|||||||
- name: Install failure annotation plugin
|
- name: Install failure annotation plugin
|
||||||
run: pip install pytest-github-actions-annotate-failures
|
run: pip install pytest-github-actions-annotate-failures
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: pytest --junitxml=pytest.xml
|
||||||
set -o pipefail
|
- name: Upload Test Report
|
||||||
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov-report=html --cov | tee pytest-coverage.txt
|
uses: actions/upload-artifact@v6
|
||||||
- name: Comment pytest code coverage
|
|
||||||
uses: MishaKav/pytest-coverage-comment@main
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
with:
|
||||||
pytest-coverage-path: ./pytest-coverage.txt
|
name: pytest-report
|
||||||
junitxml-path: ./pytest.xml
|
path: pytest.xml
|
||||||
|
retention-days: 1
|
||||||
Reference in New Issue
Block a user