From 0fe3a9282d8fd76d5deedd9cff21a296f4f3667d Mon Sep 17 00:00:00 2001 From: Christopher Junius Date: Sun, 30 Aug 2026 09:23:32 -0400 Subject: [PATCH] Add Codecov test-analytics upload CI now emits a legacy-format JUnit XML from pytest and uploads it with codecov/test-results-action (SHA-pinned v1.2.1), alongside the existing coverage upload. Enables Codecov's failed-test reporting in PR comments. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 9 ++++++++- .gitignore | 1 + CHANGELOG.md | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0472917..e1afc4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: cache: pip - run: pip install -e ".[dev]" - name: Pytest - run: pytest --cov-report=xml + run: pytest --cov-report=xml --junitxml=junit.xml -o junit_family=legacy - name: Upload coverage to Codecov if: ${{ !cancelled() }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 @@ -52,6 +52,13 @@ jobs: files: coverage.xml flags: py${{ matrix.python-version }} fail_ci_if_error: true + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: junit.xml + flags: py${{ matrix.python-version }} # Single check to gate branch protection on, so the matrix can change freely. ci-ok: diff --git a/.gitignore b/.gitignore index 5212704..1ff336a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ env/ .coverage htmlcov/ coverage.xml +junit.xml # Editors / OS .idea/ diff --git a/CHANGELOG.md b/CHANGELOG.md index a0b8d3a..8efeab8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,8 @@ follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Packaging: `src/pychess/` layout, `pyproject.toml`, `pychess` console script, `py.typed`. - Tooling: Ruff (lint + format), Mypy, pytest-cov (85% gate), `pre-commit`, all - run in CI on Python 3.12 and 3.13. + run in CI on Python 3.12 and 3.13, with Codecov coverage + test-analytics + uploads. - `perft` regression tests against published node counts; unit tests for every module.