Skip to content

Commit e251cdb

Browse files
committed
Getting the coverage comment to work again
1 parent 84a2086 commit e251cdb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/pytest.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,33 @@ jobs:
4545
hatch run dev:pytest
4646
env:
4747
COVERAGE_FILE: ".coverage.${{ matrix.os }}.${{ matrix.python-version }}"
48+
- name: Store coverage file
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
52+
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }}
53+
include-hidden-files: true
54+
55+
coverage:
56+
name: Coverage
57+
runs-on: ubuntu-latest
58+
needs: pytest
59+
permissions:
60+
pull-requests: write
61+
contents: write
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/download-artifact@v4
65+
id: download
66+
with:
67+
pattern: coverage-*
68+
merge-multiple: true
69+
- name: Python Coverage Comment
70+
uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925
71+
with:
72+
GITHUB_TOKEN: ${{ github.token }}
73+
MERGE_COVERAGE_FILES: true
74+
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
4875
- name: Store Pull Request comment to be posted
4976
uses: actions/upload-artifact@v4
5077
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'

0 commit comments

Comments
 (0)