9999 path : ./src/.coverage*
100100 include-hidden-files : true
101101 compression-level : 0 # no compression
102-
103- - name : Save PR number for coverage report
104- if : ${{ !startsWith(matrix.python-version, 'pypy') }}
105- run : |
106- mkdir -p ./pr
107- echo ${{ github.event.number }} > ./pr/NR
108- - uses : actions/upload-artifact@v4
109- if : ${{ !startsWith(matrix.python-version, 'pypy') }}
110- # Currently: v4 has a bug https://github.com/actions/upload-artifact/issues/506
111- # that fails on multiple parallel writes to the same filename.
112- continue-on-error : true
113- with :
114- overwrite : true
115- name : pr
116- path : pr/NR
102+
117103
118104 - name : Test CPython typing test suite
119105 # Test suite fails on PyPy even without typing_extensions
@@ -151,4 +137,68 @@ jobs:
151137 repo: "typing_extensions",
152138 title: `Daily tests failed on ${new Date().toDateString()}`,
153139 body: "Runs listed here: https://github.com/python/typing_extensions/actions/workflows/ci.yml",
154- })
140+ })
141+ prepare-report-coverage :
142+ name : Report coverage
143+
144+ runs-on : ubuntu-latest
145+
146+ needs : [tests]
147+
148+ if : ${{ always() }}
149+
150+ steps :
151+ - uses : actions/checkout@v4
152+ with :
153+ persist-credentials : false
154+ - name : Set up Python
155+ uses : actions/setup-python@v5
156+ with :
157+ python-version : " 3"
158+ - name : Download coverage artifacts
159+ uses : actions/download-artifact@v4
160+ with :
161+ pattern : .coverage_*
162+ path : .
163+ # merge only when files are named differently
164+ merge-multiple : true
165+ - name : Install dependencies
166+ run : pip install coverage
167+ - name : Combine coverage results
168+ run : |
169+ # List the files to see what we have
170+ echo "Combining coverage files..."
171+ ls -aR .coverage*
172+ coverage combine .coverage*
173+ echo "Creating coverage report..."
174+ coverage report
175+ coverage xml
176+
177+ - name : Code Coverage Report
178+ uses : irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
179+ with :
180+ filename : coverage.xml
181+ badge : true
182+ fail_below_min : false
183+ format : markdown
184+ hide_branch_rate : false
185+ hide_complexity : true
186+ indicators : true
187+ output : both
188+ thresholds : ' 80 90'
189+
190+ - name : Archive code coverage report
191+ uses : actions/upload-artifact@v4
192+ with :
193+ name : code-coverage-results.md
194+ path : code-coverage-results.md
195+ compression-level : 0 # no compression
196+ - name : Save PR number for coverage report
197+ run : |
198+ echo ${{ github.event.number }} > ./pr_number.txt
199+ - uses : actions/upload-artifact@v4
200+ continue-on-error : true
201+ with :
202+ name : pr_number
203+ path : pr_number.txt
204+ compression-level : 0 # no compression
0 commit comments