Skip to content
Draft
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
64 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
faa344d
Merge branch 'main' into dev/remove-codecov
kingbuzzman Jun 16, 2025
d61a45d
Update .github/workflows/main.yml
kingbuzzman Jun 16, 2025
e858136
Merge branch 'main' into dev/remove-codecov
kingbuzzman Aug 13, 2025
0054df5
Update main.yml
kingbuzzman Aug 13, 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
231 changes: 149 additions & 82 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main

Comment thread
kingbuzzman marked this conversation as resolved.
concurrency:
group: ci-main-${{ github.ref }}
Expand All @@ -20,11 +20,88 @@ permissions: {}

jobs:
test:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
Comment thread
kingbuzzman marked this conversation as resolved.
Outdated
continue-on-error: ${{ matrix.allow_failure }}
timeout-minutes: 15
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: linting,docs
python: '3.13'
allow_failure: false

# Explicitly test min pytest.
- name: py313-dj52-sqlite-pytestmin-coverage
python: '3.13'
allow_failure: false

- name: py313-dj52-postgres-xdist-coverage
python: '3.13'
allow_failure: false

- name: py313-dj51-postgres-xdist-coverage
python: '3.13'
allow_failure: false

- name: py312-dj42-postgres-xdist-coverage
python: '3.12'
allow_failure: false

- name: py311-dj50-postgres-xdist-coverage
python: '3.11'
allow_failure: false

- name: py311-dj42-postgres-xdist-coverage
python: '3.11'
allow_failure: false

- name: py310-dj52-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py310-dj51-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py310-dj42-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py311-dj51-mysql-coverage
python: '3.11'
allow_failure: false

- name: py310-dj42-mysql-coverage
python: '3.10'
allow_failure: false

- name: py39-dj42-mysql-xdist-coverage
python: '3.9'
allow_failure: false

- name: py313-djmain-sqlite-coverage
python: '3.13'
allow_failure: true

- name: py313-dj52-sqlite-coverage
python: '3.13'
allow_failure: true

- name: py312-dj51-sqlite-xdist-coverage
python: '3.12'
allow_failure: false

- name: py311-dj42-sqlite-xdist-coverage
python: '3.11'
allow_failure: false

# pypy3: not included with coverage reports (much slower then).
- name: pypy3-dj42-postgres
python: 'pypy3.9'
allow_failure: false
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -50,104 +127,94 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==4.11.1
pip install tox==4.26.0
Comment thread
kingbuzzman marked this conversation as resolved.
Outdated

- name: Run tox
run: tox -e ${{ matrix.name }}

- name: Report coverage
- name: Prepare coverage file for upload
if: contains(matrix.name, 'coverage')
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

strategy:
fail-fast: false
matrix:
include:
- name: linting,docs
python: '3.13'
allow_failure: false

# Explicitly test min pytest.
- name: py313-dj52-sqlite-pytestmin-coverage
python: '3.13'
allow_failure: false

- name: py313-dj52-postgres-xdist-coverage
python: '3.13'
allow_failure: false

- name: py313-dj51-postgres-xdist-coverage
python: '3.13'
allow_failure: false

- name: py312-dj42-postgres-xdist-coverage
python: '3.12'
allow_failure: false

- name: py311-dj50-postgres-xdist-coverage
python: '3.11'
allow_failure: false

- name: py311-dj42-postgres-xdist-coverage
python: '3.11'
allow_failure: false

- name: py310-dj52-postgres-xdist-coverage
python: '3.10'
allow_failure: false
run: mv .coverage coverage.${{ matrix.name }}

- name: py310-dj51-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py310-dj42-postgres-xdist-coverage
python: '3.10'
allow_failure: false

- name: py311-dj51-mysql-coverage
python: '3.11'
allow_failure: false
- name: Upload temporary coverage artifact
if: contains(matrix.name, 'coverage')
uses: actions/upload-artifact@v4
with:
name: coverage-artifact-${{ matrix.name }}
path: coverage.${{ matrix.name }}
retention-days: 1

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

- name: py310-dj42-mysql-coverage
python: '3.10'
allow_failure: false
- uses: actions/setup-python@v5
with:
python-version: '3.13'
check-latest: true

- name: py39-dj42-mysql-xdist-coverage
python: '3.9'
allow_failure: false
- name: Install coverage tool
run: python -m pip install coverage[toml]

- name: py313-djmain-sqlite-coverage
python: '3.13'
allow_failure: true
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
path: downloaded-coverage-artifacts
pattern: coverage-artifact-*

- name: py313-dj52-sqlite-coverage
python: '3.13'
allow_failure: true
- 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 --format=markdown >> $GITHUB_STEP_SUMMARY
Comment thread
kingbuzzman marked this conversation as resolved.
Outdated

- name: Upload combined .coverage file
uses: actions/upload-artifact@v4
with:
name: coverage-file
path: .coverage
retention-days: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 90 || 3 }}
Comment thread
kingbuzzman marked this conversation as resolved.
Outdated
include-hidden-files: true

- name: py312-dj51-sqlite-xdist-coverage
python: '3.12'
allow_failure: false
- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-html-report
path: htmlcov
retention-days: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && 90 || 3 }}

- name: py311-dj42-sqlite-xdist-coverage
python: '3.11'
allow_failure: false
- name: Delete temporary coverage artifacts from run
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really that necessary, as you already set them to expire in one day. Plus, it'd be impossible to inspect these files whenever you suspect something's wrong.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. But its just noise, i figure i'd leave it "clean" -- but you're not wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just that I've recently seen a DIY implementation of this causing CI stability issues due to GH API or network being flaky and causing chaos. That memory is still fresh :)

But also, these are about inspectability.

If you want fewer artifacts, you can run actions/upload-artifact/merge and it'll do the deletion for you, replacing these with one artifact containing all the individual files.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that i like! Thanks!

uses: geekyeggo/delete-artifact@v5
Comment thread
kingbuzzman marked this conversation as resolved.
Outdated
with:
name: coverage-artifact-*

# pypy3: not included with coverage reports (much slower then).
- name: pypy3-dj42-postgres
python: 'pypy3.9'
allow_failure: false
- 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
runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ ignore_missing_imports = true
parallel = true
source = ["${PYTESTDJANGO_COVERAGE_SRC}."]
branch = true
Comment thread
kingbuzzman marked this conversation as resolved.
omit = [
"pytest_django/_version.py",
]
[tool.coverage.report]
include = [
"pytest_django/*",
"pytest_django_test/*",
"tests/*",
]
Comment thread
kingbuzzman marked this conversation as resolved.
omit = [
Comment thread
kingbuzzman marked this conversation as resolved.
"pytest_django/_version.py",
Comment thread
kingbuzzman marked this conversation as resolved.
Outdated
]
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 @@ -42,8 +42,6 @@ commands =
coverage: coverage erase
{env:PYTESTDJANGO_TEST_RUNNER:pytest} {posargs:tests}
coverage: coverage combine
coverage: coverage report
coverage: coverage xml

[testenv:linting]
extras =
Expand Down