File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,13 +2,12 @@ name: CI
22
33permissions :
44 contents : read
5- pull-requests : write
65
76on :
87 push :
9- branches : [ "main" ]
8+ branches : ["main"]
109 pull_request :
11- branches : [ "main" ]
10+ branches : ["main"]
1211
1312env :
1413 UV_FROZEN : true
3332 needs : format
3433 strategy :
3534 matrix :
36- python-version : [ "3.11", "3.12", "3.13", "3.14" ]
35+ python-version : ["3.11", "3.12", "3.13", "3.14"]
3736 steps :
3837 - uses : actions/checkout@v6
3938 with :
@@ -68,10 +67,16 @@ jobs:
6867 pytest-cloud.xml \
6968 pytest.xml
7069
71- - name : Pytest coverage comment
72- if : github.event_name == 'pull_request' && matrix.python-version ==
73- env.COVERAGE_PYTHON
74- uses : MishaKav/pytest-coverage-comment@v1
70+ - name : Record PR number
71+ if : github.event_name == 'pull_request' && matrix.python-version == env.COVERAGE_PYTHON
72+ run : echo "${{ github.event.number }}" > pr-number.txt
73+
74+ - uses : actions/upload-artifact@v7
75+ if : github.event_name == 'pull_request' && matrix.python-version == env.COVERAGE_PYTHON
7576 with :
76- pytest-xml-coverage-path : ./coverage.xml
77- junitxml-path : ./pytest.xml
77+ name : coverage
78+ retention-days : 1
79+ path : |
80+ coverage.xml
81+ pytest.xml
82+ pr-number.txt
Original file line number Diff line number Diff line change 1+ name : Coverage report
2+
3+ on :
4+ workflow_run :
5+ workflows : ["CI"]
6+ types : [completed]
7+
8+ permissions :
9+ pull-requests : write
10+ actions : read
11+
12+ jobs :
13+ coverage :
14+ if : >-
15+ github.event.workflow_run.event == 'pull_request' &&
16+ github.event.workflow_run.conclusion == 'success'
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/download-artifact@v8
20+ with :
21+ name : coverage
22+ run-id : ${{ github.event.workflow_run.id }}
23+ github-token : ${{ secrets.GITHUB_TOKEN }}
24+
25+ - id : pr
26+ run : echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"
27+
28+ - name : Pytest coverage comment
29+ uses : MishaKav/pytest-coverage-comment@v1
30+ with :
31+ issue-number : ${{ steps.pr.outputs.number }}
32+ pytest-xml-coverage-path : ./coverage.xml
33+ junitxml-path : ./pytest.xml
You can’t perform that action at this time.
0 commit comments