From 4e57e340fbf6b0902d8c60c01884a6acef675a2a Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 05:23:43 -0400 Subject: [PATCH 01/15] Attempt to make codecov less important --- .github/workflows/main.yml | 135 +++++++++++++++++++++++++------------ 1 file changed, 92 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d56f905e..794b1492 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,49 +20,11 @@ permissions: {} jobs: test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest continue-on-error: ${{ matrix.allow_failure }} - timeout-minutes: 15 + timeout-minutes: 5 permissions: contents: read - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Setup mysql - if: contains(matrix.name, 'mysql') - run: | - sudo systemctl start mysql.service - echo "TEST_DB_USER=root" >> $GITHUB_ENV - echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV - - - name: Setup postgresql - if: contains(matrix.name, 'postgres') - run: | - sudo systemctl start postgresql.service - sudo -u postgres createuser --createdb $USER - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==4.11.1 - - - name: Run tox - run: tox -e ${{ matrix.name }} - - - name: Report coverage - 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: @@ -144,14 +106,101 @@ jobs: - name: pypy3-dj42-postgres python: 'pypy3.9' allow_failure: false + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Setup mysql + if: contains(matrix.name, 'mysql') + run: | + sudo systemctl start mysql.service + echo "TEST_DB_USER=root" >> $GITHUB_ENV + echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV + + - name: Setup postgresql + if: contains(matrix.name, 'postgres') + run: | + sudo systemctl start postgresql.service + sudo -u postgres createuser --createdb $USER + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox==4.26.0 + + - name: Run tox + run: tox -e ${{ matrix.name }} + + - name: Prepare coverage file for upload + run: mv .coverage .coverage.${{ matrix.name }} + + - name: Upload temporary coverage artifact + 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: read + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - 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/ \; + echo "Files in combined_coverage_data for combining:" + ls -R combined_coverage_data + cd combined_coverage_data + coverage combine --keep + echo "Combined .coverage file generated. Generating XML report." + coverage xml -o ../coverage.xml + cd .. + echo "Generated coverage.xml in workspace root:" + ls -l coverage.xml + + - 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 + check: 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 From b4b91748ccb1ed0521e190e18a53f89b509e7ba3 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:15:49 -0400 Subject: [PATCH 02/15] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 794b1492..f4eb7060 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,7 +137,9 @@ jobs: run: tox -e ${{ matrix.name }} - name: Prepare coverage file for upload - run: mv .coverage .coverage.${{ matrix.name }} + run: | + ls -lash + mv .coverage .coverage.${{ matrix.name }} - name: Upload temporary coverage artifact uses: actions/upload-artifact@v4 From d85fe25b66950be835012473211c9401c140b372 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:23:39 -0400 Subject: [PATCH 03/15] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4eb7060..e02b2b9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,11 +137,13 @@ jobs: run: tox -e ${{ matrix.name }} - name: Prepare coverage file for upload + if: contains(matrix.name, 'coverage') run: | ls -lash mv .coverage .coverage.${{ matrix.name }} - name: Upload temporary coverage artifact + if: contains(matrix.name, 'coverage') uses: actions/upload-artifact@v4 with: name: coverage-artifact-${{ matrix.name }} From 4674b616192d671c38cf109b12b3f974ee578484 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:24:52 -0400 Subject: [PATCH 04/15] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e02b2b9f..0dcdc34c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,7 +131,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox==4.26.0 + pip install tox==4.24.0 - name: Run tox run: tox -e ${{ matrix.name }} From 8ee5187f1e9a60d9fca15601f4c3d5ebd2dea730 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:25:47 -0400 Subject: [PATCH 05/15] Update pyproject.toml --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3fb403da..aa623727 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ classifiers = [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From e05f94e8a0332e47bf2dd45d1e3165bf47d22563 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:26:43 -0400 Subject: [PATCH 06/15] Update main.yml --- .github/workflows/main.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d56f905e..ec1afbbe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,15 +131,6 @@ jobs: python: '3.11' allow_failure: false - - name: py38-dj42-sqlite-xdist-coverage - python: '3.8' - allow_failure: false - - # Explicitly test min pytest. - - name: py38-dj42-sqlite-pytestmin-coverage - python: '3.8' - allow_failure: false - # pypy3: not included with coverage reports (much slower then). - name: pypy3-dj42-postgres python: 'pypy3.9' From ed346b6d0bee268c683dc8dc6535d35dbf49bdcb Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:28:56 -0400 Subject: [PATCH 07/15] Update contributing.rst --- docs/contributing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index d5003fc7..897d4ae0 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -140,10 +140,10 @@ writing), running them all will take a long time. All valid configurations can be found in `tox.ini`. To test against a few of them, invoke tox with the `-e` flag:: - $ tox -e py38-dj32-postgres,py310-dj41-mysql + $ tox -e py39-dj42-postgres,py310-dj52-mysql -This will run the tests on Python 3.8/Django 3.2/PostgeSQL and Python -3.10/Django 4.1/MySQL. +This will run the tests on Python 3.9/Django 4.2/PostgeSQL and Python +3.10/Django 5.2/MySQL. Measuring test coverage From 9faec5c9943535c84131ad58be37f7cb63da83e4 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:30:26 -0400 Subject: [PATCH 08/15] Update README.rst --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 90a9fb8d..87291333 100644 --- a/README.rst +++ b/README.rst @@ -32,9 +32,9 @@ pytest-django allows you to test your Django project/applications with the `_ * Version compatibility: - * Django: 4.2, 5.0, 5.1, 5.2 and latest main branch (compatible at the time + * Django: 4.2, 5.1, 5.2 and latest main branch (compatible at the time of each release) - * Python: CPython>=3.8 or PyPy 3 + * Python: CPython>=3.9 or PyPy 3 * pytest: >=7.0 For compatibility with older versions, use previous pytest-django releases. From 73883c5221ade9eb27224ddc240b6aa311e9a747 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:31:29 -0400 Subject: [PATCH 09/15] Update pyproject.toml --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa623727..61f2c006 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" name = "pytest-django" description = "A Django plugin for pytest." readme = "README.rst" -requires-python = ">=3.8" +requires-python = ">=3.9" dynamic = ["version"] authors = [ { name = "Andreas Pelme", email = "andreas@pelme.se" }, @@ -22,7 +22,6 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Framework :: Django :: 4.2", - "Framework :: Django :: 5.0", "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", "Intended Audience :: Developers", From a0c7a972be5c9192404e8883c7007a33564ae00b Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 10:32:32 -0400 Subject: [PATCH 10/15] Update tox.ini --- tox.ini | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index aed0b8a3..e064bc0c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [tox] envlist = py313-dj{main,52,51}-postgres - py312-dj{main,52,51,50,42}-postgres - py311-dj{main,52,51,50,42}-postgres - py310-dj{main,52,51,50,42}-postgres + py312-dj{main,52,51,42}-postgres + py311-dj{main,52,51,42}-postgres + py310-dj{main,52,51,42}-postgres py39-dj42-postgres - py38-dj42-postgres linting [testenv] From 71151c26555cb113608fdab87edcfd8055e4fea4 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 10:40:46 -0400 Subject: [PATCH 11/15] Minor import fixes (100% automatic) --- pytest_django/asserts.py | 3 ++- pytest_django/fixtures.py | 4 +--- pytest_django/plugin.py | 3 ++- pytest_django/runner.py | 3 ++- pytest_django_test/db_helpers.py | 2 +- tests/test_database.py | 2 +- tests/test_fixtures.py | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pytest_django/asserts.py b/pytest_django/asserts.py index 14741066..0401b2ea 100644 --- a/pytest_django/asserts.py +++ b/pytest_django/asserts.py @@ -4,8 +4,9 @@ from __future__ import annotations +from collections.abc import Sequence from functools import wraps -from typing import TYPE_CHECKING, Any, Callable, Sequence +from typing import TYPE_CHECKING, Any, Callable from django import VERSION from django.test import LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase diff --git a/pytest_django/fixtures.py b/pytest_django/fixtures.py index 6dc05fdb..358bfd68 100644 --- a/pytest_django/fixtures.py +++ b/pytest_django/fixtures.py @@ -3,6 +3,7 @@ from __future__ import annotations import os +from collections.abc import Generator, Iterable, Sequence from contextlib import contextmanager from functools import partial from typing import ( @@ -11,13 +12,10 @@ Any, Callable, ContextManager, - Generator, - Iterable, List, Literal, Optional, Protocol, - Sequence, Tuple, Union, ) diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index e8e629f4..e2a73c82 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -12,8 +12,9 @@ import pathlib import sys import types +from collections.abc import Generator from functools import reduce -from typing import TYPE_CHECKING, ContextManager, Generator, List, NoReturn +from typing import TYPE_CHECKING, ContextManager, List, NoReturn import pytest diff --git a/pytest_django/runner.py b/pytest_django/runner.py index d9032622..1b6571cc 100644 --- a/pytest_django/runner.py +++ b/pytest_django/runner.py @@ -1,5 +1,6 @@ from argparse import ArgumentParser -from typing import Any, Iterable +from collections.abc import Iterable +from typing import Any class TestRunner: diff --git a/pytest_django_test/db_helpers.py b/pytest_django_test/db_helpers.py index 712af0d3..b9efe86d 100644 --- a/pytest_django_test/db_helpers.py +++ b/pytest_django_test/db_helpers.py @@ -3,7 +3,7 @@ import os import sqlite3 import subprocess -from typing import Mapping +from collections.abc import Mapping import pytest from django.conf import settings diff --git a/tests/test_database.py b/tests/test_database.py index c6389756..2fec1352 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Generator +from collections.abc import Generator import pytest from django.db import connection, transaction diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index f88ed802..709ae6c9 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -5,8 +5,8 @@ """ import socket +from collections.abc import Generator from contextlib import contextmanager -from typing import Generator from urllib.error import HTTPError from urllib.request import urlopen From bb091a526b55dddf1f7ceb8f62c7868d12b4e523 Mon Sep 17 00:00:00 2001 From: kingbuzzman Date: Mon, 26 May 2025 10:47:11 -0400 Subject: [PATCH 12/15] Minor import fixes (100% manual) --- pytest_django/fixtures.py | 24 ++++++------------------ pytest_django/plugin.py | 9 +++++---- tests/test_runner.py | 2 +- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/pytest_django/fixtures.py b/pytest_django/fixtures.py index 358bfd68..c1bf9ca1 100644 --- a/pytest_django/fixtures.py +++ b/pytest_django/fixtures.py @@ -4,21 +4,9 @@ import os from collections.abc import Generator, Iterable, Sequence -from contextlib import contextmanager +from contextlib import AbstractContextManager, contextmanager from functools import partial -from typing import ( - TYPE_CHECKING, - AbstractSet, - Any, - Callable, - ContextManager, - List, - Literal, - Optional, - Protocol, - Tuple, - Union, -) +from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Protocol, Union import pytest @@ -35,9 +23,9 @@ _DjangoDbDatabases = Optional[Union[Literal["__all__"], Iterable[str]]] -_DjangoDbAvailableApps = Optional[List[str]] +_DjangoDbAvailableApps = Optional[list[str]] # transaction, reset_sequences, databases, serialized_rollback, available_apps -_DjangoDb = Tuple[bool, bool, _DjangoDbDatabases, bool, _DjangoDbAvailableApps] +_DjangoDb = tuple[bool, bool, _DjangoDbDatabases, bool, _DjangoDbAvailableApps] __all__ = [ @@ -155,7 +143,7 @@ def _get_databases_for_test(test: pytest.Item) -> tuple[Iterable[str], bool]: def _get_databases_for_setup( items: Sequence[pytest.Item], -) -> tuple[AbstractSet[str], AbstractSet[str]]: +) -> tuple[set[str], set[str]]: """Get the database aliases that need to be setup, and the subset that needs to be serialized.""" # Code derived from django.test.utils.DiscoverRunner.get_databases(). @@ -734,7 +722,7 @@ def __call__( *, using: str = ..., execute: bool = ..., - ) -> ContextManager[list[Callable[[], Any]]]: + ) -> AbstractContextManager[list[Callable[[], Any]]]: pass # pragma: no cover diff --git a/pytest_django/plugin.py b/pytest_django/plugin.py index e2a73c82..00c3744b 100644 --- a/pytest_django/plugin.py +++ b/pytest_django/plugin.py @@ -13,8 +13,9 @@ import sys import types from collections.abc import Generator +from contextlib import AbstractContextManager from functools import reduce -from typing import TYPE_CHECKING, ContextManager, List, NoReturn +from typing import TYPE_CHECKING, NoReturn import pytest @@ -260,7 +261,7 @@ def _get_boolean_value( ) from None -report_header_key = pytest.StashKey[List[str]]() +report_header_key = pytest.StashKey[list[str]]() @pytest.hookimpl() @@ -838,13 +839,13 @@ def _blocking_wrapper(*args, **kwargs) -> NoReturn: '"db" or "transactional_db" fixtures to enable it.' ) - def unblock(self) -> ContextManager[None]: + def unblock(self) -> AbstractContextManager[None]: """Enable access to the Django database.""" self._save_active_wrapper() self._dj_db_wrapper.ensure_connection = self._real_ensure_connection return _DatabaseBlockerContextManager(self) - def block(self) -> ContextManager[None]: + def block(self) -> AbstractContextManager[None]: """Disable access to the Django database.""" self._save_active_wrapper() self._dj_db_wrapper.ensure_connection = self._blocking_wrapper diff --git a/tests/test_runner.py b/tests/test_runner.py index 71fd7160..a0bee059 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -6,7 +6,7 @@ @pytest.mark.parametrize( - "kwargs, expected", + ("kwargs", "expected"), [ ({}, call(["tests"])), ({"verbosity": 0}, call(["--quiet", "tests"])), From ce156bec542e4d5107843e4a6fcad46ca0cc36f7 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:15:57 -0400 Subject: [PATCH 13/15] Update main.yml --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcc57620..5c0a7532 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,8 +93,7 @@ jobs: python: '3.11' allow_failure: false - # pypy3: not included with coverage reports (much slower then). - - name: pypy3-dj42-postgres + - name: pypy3-dj42-postgres-coverage python: 'pypy3.9' allow_failure: false steps: From 3dadd6794791736087d602d4128b6093fd793ff9 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:19:08 -0400 Subject: [PATCH 14/15] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c0a7532..ccffc63c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,7 +121,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox==4.24.0 + pip install tox==4.26.0 - name: Run tox run: tox -e ${{ matrix.name }} From 95981481fd846938236eab1638d4723ba6e149e8 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 26 May 2025 12:21:16 -0400 Subject: [PATCH 15/15] Update main.yml --- .github/workflows/main.yml | 122 ++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ccffc63c..83cd0ab4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -140,64 +140,64 @@ jobs: 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: read - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - 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/ \; - echo "Files in combined_coverage_data for combining:" - ls -R combined_coverage_data - cd combined_coverage_data - coverage combine --keep - echo "Combined .coverage file generated. Generating XML report." - coverage xml -o ../coverage.xml - cd .. - echo "Generated coverage.xml in workspace root:" - ls -l coverage.xml - - - 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: - if: always() - - needs: - - report-coverage - - runs-on: ubuntu-latest - - steps: - - name: Decide whether the needed jobs succeeded or failed - uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 - with: - jobs: ${{ toJSON(needs) }} + # report-coverage: + # name: Report Combined Coverage + # runs-on: ubuntu-latest + # needs: test + # if: always() + # permissions: + # contents: read + # actions: read + # steps: + # - uses: actions/checkout@v4 + # with: + # persist-credentials: false + + # - uses: actions/setup-python@v5 + # with: + # python-version: '3.11' + + # - 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/ \; + # echo "Files in combined_coverage_data for combining:" + # ls -R combined_coverage_data + # cd combined_coverage_data + # coverage combine --keep + # echo "Combined .coverage file generated. Generating XML report." + # coverage xml -o ../coverage.xml + # cd .. + # echo "Generated coverage.xml in workspace root:" + # ls -l coverage.xml + + # - 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: + # if: always() + + # needs: + # - report-coverage + + # runs-on: ubuntu-latest + + # steps: + # - name: Decide whether the needed jobs succeeded or failed + # uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302 + # with: + # jobs: ${{ toJSON(needs) }}