Skip to content

Attempt to make codecov less important #1203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
4e57e34
Attempt to make codecov less important
kingbuzzman May 26, 2025
b4b9174
Update main.yml
kingbuzzman May 26, 2025
d85fe25
Update main.yml
kingbuzzman May 26, 2025
4674b61
Update main.yml
kingbuzzman May 26, 2025
8ee5187
Update pyproject.toml
kingbuzzman May 26, 2025
e05f94e
Update main.yml
kingbuzzman May 26, 2025
ed346b6
Update contributing.rst
kingbuzzman May 26, 2025
9faec5c
Update README.rst
kingbuzzman May 26, 2025
73883c5
Update pyproject.toml
kingbuzzman May 26, 2025
a0c7a97
Update tox.ini
kingbuzzman May 26, 2025
71151c2
Minor import fixes (100% automatic)
kingbuzzman May 26, 2025
bb091a5
Minor import fixes (100% manual)
kingbuzzman May 26, 2025
ab643df
Merge branch 'dev/remote-py38' into dev/remove-codecov
kingbuzzman May 26, 2025
ce156be
Update main.yml
kingbuzzman May 26, 2025
3dadd67
Update main.yml
kingbuzzman May 26, 2025
9598148
Update main.yml
kingbuzzman May 26, 2025
b2e9a9d
Update main.yml
kingbuzzman May 26, 2025
454fc18
Add debug output to coverage file preparation in main.yml
kingbuzzman May 26, 2025
574dea3
Remove coverage report and XML generation commands from tox.ini
kingbuzzman May 26, 2025
5f92bc2
Refactor coverage artifact naming in main.yml to remove leading dot
kingbuzzman May 26, 2025
0dff300
Streamline event triggers in main.yml to use array syntax for push an…
kingbuzzman May 26, 2025
f9bd682
.
kingbuzzman May 26, 2025
77a07e2
Enhance main.yml workflow by refining event triggers and simplifying …
kingbuzzman May 26, 2025
ef377e5
.
kingbuzzman May 26, 2025
d795df0
.
kingbuzzman May 26, 2025
9a1375a
Merge branch 'main' into dev/remove-codecov
kingbuzzman May 26, 2025
48e6ea9
Update pyproject.toml to exclude pytest_django/_version.py from coverage
kingbuzzman May 26, 2025
a36659e
Refactor coverage configuration in pyproject.toml to include and omit…
kingbuzzman May 26, 2025
45cb413
.
kingbuzzman May 26, 2025
9f9cf83
Update main.yml
kingbuzzman May 27, 2025
9bff05a
Update main.yml
kingbuzzman May 27, 2025
a5d66c7
Update main.yml
kingbuzzman May 27, 2025
1ffc476
.
kingbuzzman May 27, 2025
186dcc4
Enhance coverage report configuration in main.yml to include markdown…
kingbuzzman May 27, 2025
e3a6ea1
Remove pytest_django/_version.py from coverage omission list in pypro…
kingbuzzman May 27, 2025
febb65c
..i think copilot led me down the wrong road
kingbuzzman May 27, 2025
a946de1
Ok not soo wrong..
kingbuzzman May 27, 2025
e38450f
Update main.yml
kingbuzzman May 27, 2025
917a326
Refactor retention days logic in main.yml to use a dedicated step for…
kingbuzzman May 27, 2025
a890bd3
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 2, 2025
9bcbcd8
.
kingbuzzman Jun 3, 2025
3f519be
.
kingbuzzman Jun 3, 2025
075a8a9
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 3, 2025
5ee4928
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 3, 2025
78e77c6
zizmor changes
kingbuzzman Jun 3, 2025
f8f4e3f
Update main.yml
kingbuzzman Jun 3, 2025
e188210
Update pyproject.toml
kingbuzzman Jun 3, 2025
dfbc2eb
Update .github/zizmor.yml
kingbuzzman Jun 4, 2025
3faf64b
Update .github/workflows/main.yml
kingbuzzman Jun 4, 2025
6e8b318
Update .github/workflows/main.yml
kingbuzzman Jun 4, 2025
9958235
Update .github/workflows/main.yml
kingbuzzman Jun 4, 2025
a44cb3a
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 4, 2025
595b61e
Update pyproject.toml
kingbuzzman Jun 4, 2025
c0c7494
Update pyproject.toml
kingbuzzman Jun 4, 2025
f9004d3
Update pyproject.toml
kingbuzzman Jun 4, 2025
7eb83ca
Update .github/workflows/main.yml
kingbuzzman Jun 4, 2025
764ae23
Update .github/workflows/main.yml
kingbuzzman Jun 4, 2025
1b90774
Update .github/workflows/main.yml
kingbuzzman Jun 4, 2025
66be0eb
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 5, 2025
9ea2987
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 84 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ jobs:
sarif_file: zizmor.sarif
category: zizmor

- name: Report coverage
- name: Prepare coverage file for upload
if: contains(matrix.name, 'coverage')
uses: codecov/codecov-action@v5
run: mv .coverage coverage.${TOXENV}

- name: Upload temporary coverage artifact
if: contains(matrix.name, 'coverage')
uses: actions/upload-artifact@v4
with:
fail_ci_if_error: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
name: coverage-artifact-${{ matrix.name }}
path: coverage.${{ matrix.name }}
retention-days: 1

strategy:
fail-fast: false
Expand Down Expand Up @@ -151,11 +155,85 @@ jobs:
python: 'pypy3.9'
allow_failure: false

report-coverage:
name: Report Combined Coverage
runs-on: ubuntu-24.04
needs: test
if: always()
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install coverage tool
run: python -m pip install coverage[toml]

- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
path: downloaded-coverage-artifacts
pattern: coverage-artifact-*

- name: Combine coverage reports
run: |
mkdir combined_coverage_data
find downloaded-coverage-artifacts -type f -name 'coverage.*' -exec cp {} combined_coverage_data/ \;
coverage combine combined_coverage_data/*
coverage xml
coverage html
coverage report --show-missing --format=markdown >> $GITHUB_STEP_SUMMARY

- name: Determine retention days
id: determine-retention-days
run: |
if [ "${GITHUB_REF}" = "refs/heads/main" ] || [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "retention_days=90" >> $GITHUB_OUTPUT
else
echo "retention_days=3" >> $GITHUB_OUTPUT
fi
env:
GITHUB_REF: ${{ github.ref }}

- name: Upload combined .coverage file
uses: actions/upload-artifact@v4
with:
name: coverage-file
path: .coverage
retention-days: ${{ steps.determine-retention-days.outputs.retention_days }}
include-hidden-files: true

- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-html-report
path: htmlcov
retention-days: ${{ steps.determine-retention-days.outputs.retention_days }}

- name: Delete temporary coverage artifacts from run
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # 5.1.0
with:
name: coverage-artifact-*

- name: Report coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

check: # This job does nothing and is only used for the branch protection
if: always()

needs:
- test
- report-coverage

runs-on: ubuntu-24.04

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ include = [
"pytest_django_test/*",
"tests/*",
]
omit = [
"pytest_django/_version.py", # coverage fails when the file stops existing randomly, see .gitignore
]
skip_covered = true
exclude_lines = [
"pragma: no cover",
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ commands =
coverage: coverage erase
{env:PYTESTDJANGO_TEST_RUNNER:pytest} {posargs:tests}
coverage: coverage combine
coverage: coverage report
coverage: coverage xml

[testenv:linting]
dependency_groups = linting
Expand Down