@@ -65,15 +65,13 @@ jobs:
6565 sarif_file : zizmor.sarif
6666 category : zizmor
6767
68- - name : Upload temporary coverage artifact
68+ - name : Report coverage
6969 if : contains(matrix.name, 'coverage')
70- uses : actions/upload-artifact@v4
71- timeout-minutes : 1
70+ uses : codecov/codecov-action@v5
7271 with :
73- name : coverage-artifact-${{ matrix.name }}
74- path : .coverage.*
75- retention-days : 1
76- include-hidden-files : true
72+ fail_ci_if_error : true
73+ files : ./coverage.xml
74+ token : ${{ secrets.CODECOV_TOKEN }}
7775
7876 strategy :
7977 fail-fast : false
@@ -142,87 +140,11 @@ jobs:
142140 allow_failure : false
143141 use_factor : false
144142
145- report-coverage :
146- name : Report Combined Coverage
147- runs-on : ubuntu-24.04
148- needs : test
149- if : always()
150- permissions :
151- contents : read
152- actions : write
153- steps :
154- - uses : actions/checkout@v4
155- with :
156- persist-credentials : false
157-
158- - uses : actions/setup-python@v5
159- with :
160- python-version : ' 3.13'
161-
162- - name : Install coverage tool
163- run : python -m pip install coverage[toml]
164-
165- - name : Download all coverage artifacts
166- uses : actions/download-artifact@v4
167- with :
168- path : .
169- pattern : coverage-artifact-*
170-
171- - name : Combine coverage reports
172- run : |
173- coverage combine coverage-artifact-*
174- coverage xml
175- coverage html
176- coverage report --show-missing --format=markdown >> $GITHUB_STEP_SUMMARY
177-
178- - name : Determine retention days
179- id : determine-retention-days
180- run : >-
181- echo "retention_days=${RETENTION_DAYS}"
182- >> "${GITHUB_OUTPUT}"
183- env :
184- RETENTION_DAYS : >-
185- ${{
186- (
187- github.ref_type == 'tag'
188- && github.ref_name == github.event.repository.default_branch
189- )
190- && 90
191- || 3
192- }}
193-
194- - name : Upload combined .coverage file
195- uses : actions/upload-artifact@v4
196- with :
197- name : coverage-file
198- path : .coverage
199- retention-days : ${{ steps.determine-retention-days.outputs.retention_days }}
200-
201- - name : Upload HTML coverage report
202- uses : actions/upload-artifact@v4
203- with :
204- name : coverage-html-report
205- path : htmlcov
206- retention-days : ${{ steps.determine-retention-days.outputs.retention_days }}
207-
208- - name : Delete temporary coverage artifacts from run
209- uses : geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # 5.1.0
210- with :
211- name : coverage-artifact-*
212-
213- - name : Report coverage to Codecov
214- uses : codecov/codecov-action@v5
215- with :
216- files : ./coverage.xml
217- token : ${{ secrets.CODECOV_TOKEN }}
218- fail_ci_if_error : true
219- verbose : true
220-
221143 check : # This job does nothing and is only used for the branch protection
222144 if : always()
223145
224146 needs :
225- - report-coverage
147+ - test
226148
227149 runs-on : ubuntu-24.04
228150
0 commit comments