Skip to content

Commit 29aa84e

Browse files
committed
Progress towards no-codecov
1 parent de703ff commit 29aa84e

File tree

6 files changed

+133
-93
lines changed

6 files changed

+133
-93
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ jobs:
120120

121121
steps:
122122
- uses: actions/checkout@v5
123-
with:
124-
# See https://github.com/codecov/codecov-action/issues/190.
125-
fetch-depth: 2
126123

127124
- name: Install uv
128125
uses: astral-sh/setup-uv@v6
@@ -179,24 +176,13 @@ jobs:
179176
# https://github.com/VWS-Python/vws-python-mock/issues/708
180177
cat ./coverage.xml
181178
182-
# We run this job on every PR, on every merge to main, and nightly.
183-
# This causes us to hit an issue with Codecov.
184-
#
185-
# We see "Too many uploads to this commit.".
186-
# See https://community.codecov.io/t/too-many-uploads-to-this-commit/2574.
187-
#
188-
# To work around this, we do not upload coverage data on scheduled runs.
189-
# We print the event name here to help with debugging.
190-
- name: Show event name
191-
run: |
192-
echo ${{ github.event_name }}
193-
194-
- name: Upload coverage to Codecov
195-
uses: codecov/codecov-action@v5
179+
- name: Upload coverage data
180+
uses: actions/upload-artifact@v4
196181
with:
197-
fail_ci_if_error: true
198-
token: ${{ secrets.CODECOV_TOKEN }}
199-
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
182+
name: coverage-data-${{ matrix.python-version }}-${{ matrix.ci_pattern }}
183+
path: .coverage.*
184+
include-hidden-files: true
185+
if-no-files-found: ignore
200186

201187
completion-ci:
202188
needs: build
@@ -209,3 +195,41 @@ jobs:
209195
echo "One or more matrix jobs failed"
210196
exit 1
211197
fi
198+
199+
coverage:
200+
name: Combine & check coverage
201+
if: always()
202+
needs: build
203+
runs-on: ubuntu-latest
204+
205+
steps:
206+
- uses: actions/checkout@v5
207+
- uses: actions/setup-python@v5
208+
with:
209+
# Use latest Python, so it understands all syntax.
210+
python-version: '3.13'
211+
212+
- uses: actions/download-artifact@v4
213+
with:
214+
pattern: coverage-data-*
215+
merge-multiple: true
216+
217+
- name: Combine coverage & fail if it's <100%
218+
run: |
219+
uv tool install 'coverage[toml]'
220+
221+
coverage combine
222+
coverage html --skip-covered --skip-empty
223+
224+
# Report and write to summary.
225+
coverage report --format=markdown >> "$GITHUB_STEP_SUMMARY"
226+
227+
# Report again and fail if under 100%.
228+
coverage report --fail-under=100
229+
230+
- name: Upload HTML report if check failed
231+
uses: actions/upload-artifact@v4
232+
with:
233+
name: html-report
234+
path: htmlcov
235+
if: ${{ failure() }}

.github/workflows/skip-tests.yml

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ jobs:
2727

2828
steps:
2929
- uses: actions/checkout@v5
30-
with:
31-
# See https://github.com/codecov/codecov-action/issues/190.
32-
fetch-depth: 2
3330

3431
- name: Install uv
3532
uses: astral-sh/setup-uv@v6
@@ -58,35 +55,13 @@ jobs:
5855
env:
5956
UV_PYTHON: ${{ matrix.python-version }}
6057

61-
- name: Show coverage file
62-
run: |
63-
# Sometimes we have been sure that we have 100% coverage, but codecov
64-
# says otherwise.
65-
#
66-
# We show the coverage file here to help with debugging.
67-
# https://github.com/VWS-Python/vws-python-mock/issues/708
68-
cat ./coverage.xml
69-
70-
# We run this job on every PR, on every merge to main, and nightly.
71-
# This causes us to hit an issue with Codecov.
72-
#
73-
# We see "Too many uploads to this commit.".
74-
# See https://community.codecov.io/t/too-many-uploads-to-this-commit/2574.
75-
#
76-
# To work around this, we do not upload coverage data on scheduled runs.
77-
# We print the event name here to help with debugging.
78-
- name: Show event name
79-
run: |
80-
echo ${{ github.event_name }}
81-
82-
- name: Upload coverage to Codecov
83-
uses: codecov/codecov-action@v5
58+
- name: Upload coverage data
59+
uses: actions/upload-artifact@v4
8460
with:
85-
fail_ci_if_error: true
86-
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
87-
# which tells us to use the token to avoid errors.
88-
token: ${{ secrets.CODECOV_TOKEN }}
89-
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
61+
name: coverage-data-skip-tests-${{ matrix.python-version }}
62+
path: .coverage.*
63+
include-hidden-files: true
64+
if-no-files-found: ignore
9065

9166
completion-skip-tests:
9267
needs: build
@@ -99,3 +74,41 @@ jobs:
9974
echo "One or more matrix jobs failed"
10075
exit 1
10176
fi
77+
78+
coverage-skip-tests:
79+
name: Combine & check coverage (skip-tests)
80+
if: always()
81+
needs: build
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- uses: actions/checkout@v5
86+
- uses: actions/setup-python@v5
87+
with:
88+
# Use latest Python, so it understands all syntax.
89+
python-version: '3.13'
90+
91+
- uses: actions/download-artifact@v4
92+
with:
93+
pattern: coverage-data-skip-tests-*
94+
merge-multiple: true
95+
96+
- name: Combine coverage & fail if it's <100%
97+
run: |
98+
uv tool install 'coverage[toml]'
99+
100+
coverage combine
101+
coverage html --skip-covered --skip-empty
102+
103+
# Report and write to summary.
104+
coverage report --format=markdown >> "$GITHUB_STEP_SUMMARY"
105+
106+
# Report again and fail if under 100%.
107+
coverage report --fail-under=100
108+
109+
- name: Upload HTML report if check failed
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: html-report-skip-tests
113+
path: htmlcov
114+
if: ${{ failure() }}

.github/workflows/windows-ci.yml

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v5
28-
with:
29-
# See https://github.com/codecov/codecov-action/issues/190.
30-
fetch-depth: 2
3128

3229
- name: Install uv
3330
uses: astral-sh/setup-uv@v6
@@ -47,35 +44,13 @@ jobs:
4744
env:
4845
UV_PYTHON: ${{ matrix.python-version }}
4946

50-
- name: Show coverage file
51-
run: |
52-
# Sometimes we have been sure that we have 100% coverage, but codecov
53-
# says otherwise.
54-
#
55-
# We show the coverage file here to help with debugging.
56-
# https://github.com/VWS-Python/vws-python-mock/issues/708
57-
cat ./coverage.xml
58-
59-
# We run this job on every PR, on every merge to main, and nightly.
60-
# This causes us to hit an issue with Codecov.
61-
#
62-
# We see "Too many uploads to this commit.".
63-
# See https://community.codecov.io/t/too-many-uploads-to-this-commit/2574.
64-
#
65-
# To work around this, we do not upload coverage data on scheduled runs.
66-
# We print the event name here to help with debugging.
67-
- name: Show event name
68-
run: |
69-
echo ${{ github.event_name }}
70-
71-
- name: Upload coverage to Codecov
72-
uses: codecov/codecov-action@v5
47+
- name: Upload coverage data
48+
uses: actions/upload-artifact@v4
7349
with:
74-
fail_ci_if_error: true
75-
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
76-
# which tells us to use the token to avoid errors.
77-
token: ${{ secrets.CODECOV_TOKEN }}
78-
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
50+
name: coverage-data-windows-${{ matrix.python-version }}
51+
path: .coverage.*
52+
include-hidden-files: true
53+
if-no-files-found: ignore
7954

8055
completion-windows-ci:
8156
needs: build
@@ -88,3 +63,41 @@ jobs:
8863
echo "One or more matrix jobs failed"
8964
exit 1
9065
fi
66+
67+
coverage-windows:
68+
name: Combine & check coverage (Windows)
69+
if: always()
70+
needs: build
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- uses: actions/checkout@v5
75+
- uses: actions/setup-python@v5
76+
with:
77+
# Use latest Python, so it understands all syntax.
78+
python-version: '3.13'
79+
80+
- uses: actions/download-artifact@v4
81+
with:
82+
pattern: coverage-data-windows-*
83+
merge-multiple: true
84+
85+
- name: Combine coverage & fail if it's <100%
86+
run: |
87+
uv tool install 'coverage[toml]'
88+
89+
coverage combine
90+
coverage html --skip-covered --skip-empty
91+
92+
# Report and write to summary.
93+
coverage report --format=markdown >> "$GITHUB_STEP_SUMMARY"
94+
95+
# Report again and fail if under 100%.
96+
coverage report --fail-under=100
97+
98+
- name: Upload HTML report if check failed
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: html-report-windows
102+
path: htmlcov
103+
if: ${{ failure() }}

README.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|Build Status| |codecov| |PyPI|
1+
|Build Status| |PyPI|
22

33
VWS Mock
44
========
@@ -56,8 +56,6 @@ This includes details on how to use the mock, options, and details of the differ
5656

5757
.. |Build Status| image:: https://github.com/VWS-Python/vws-python-mock/actions/workflows/ci.yml/badge.svg?branch=main
5858
:target: https://github.com/VWS-Python/vws-python-mock/actions
59-
.. |codecov| image:: https://codecov.io/gh/VWS-Python/vws-python-mock/branch/main/graph/badge.svg
60-
:target: https://codecov.io/gh/VWS-Python/vws-python-mock
6159
.. |PyPI| image:: https://badge.fury.io/py/VWS-Python-Mock.svg
6260
:target: https://badge.fury.io/py/VWS-Python-Mock
6361
.. |minimum-python-version| replace:: 3.13

codecov.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ ignore = [
313313
"Makefile",
314314
"ci",
315315
"ci/**",
316-
"codecov.yaml",
317316
"docs",
318317
"docs/**",
319318
".git_archival.txt",

0 commit comments

Comments
 (0)