From 7cc4ccd03a0c8a224d11ddf50127d93ac3f66c86 Mon Sep 17 00:00:00 2001 From: Tim Grelka Date: Mon, 2 Feb 2026 23:07:59 +0100 Subject: [PATCH] fix: use different method to comment test report --- .github/workflows/pytest-report.yml | 23 +++++++++++++++++++++++ .github/workflows/pytest.yml | 16 ++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/pytest-report.yml diff --git a/.github/workflows/pytest-report.yml b/.github/workflows/pytest-report.yml new file mode 100644 index 0000000..b55fca1 --- /dev/null +++ b/.github/workflows/pytest-report.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c7cef8f..59c149e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -2,8 +2,6 @@ name: Pytest on: pull_request permissions: contents: read - checks: write - pull-requests: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -21,12 +19,10 @@ jobs: - name: Install failure annotation plugin run: pip install pytest-github-actions-annotate-failures - name: Test with pytest - run: | - set -o pipefail - pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov-report=html --cov | tee pytest-coverage.txt - - name: Comment pytest code coverage - uses: MishaKav/pytest-coverage-comment@main - if: ${{ always() }} + run: pytest --junitxml=pytest.xml + - name: Upload Test Report + uses: actions/upload-artifact@v6 with: - pytest-coverage-path: ./pytest-coverage.txt - junitxml-path: ./pytest.xml + name: pytest-report + path: pytest.xml + retention-days: 1 \ No newline at end of file