Skip to content

Upload pytest coverage to GitHub from the latest Python CI job#68

Closed
hspaans with Copilot wants to merge 2 commits into
masterfrom
copilot/add-code-coverage-workflow
Closed

Upload pytest coverage to GitHub from the latest Python CI job#68
hspaans with Copilot wants to merge 2 commits into
masterfrom
copilot/add-code-coverage-workflow

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This PR adds code coverage upload to the CI workflow by publishing the pytest-generated Cobertura report to GitHub, scoped to the latest Python version in the test matrix.

  • CI workflow updates

    • Added code-quality: write permission to the tox job so coverage upload is authorized.
    • Kept the existing Python matrix intact and limited coverage upload behavior to 3.14 (latest configured version).
  • Coverage artifact generation

    • Extended test invocation options for the 3.14 matrix run to emit coverage.xml:
      • --cov-report=xml:coverage.xml
    • Left non-latest matrix runs unchanged to avoid redundant uploads.
  • Coverage upload step

    • Added actions/upload-code-coverage@v1 gated by if: matrix.py == '3.14'.
    • Configured required inputs:
      • file: coverage.xml
      • language: Python
      • label: code-coverage/pytest
- name: Upload code coverage report
  if: matrix.py == '3.14'
  uses: actions/upload-code-coverage@v1
  with:
    file: coverage.xml
    language: Python
    label: code-coverage/pytest

Copilot AI linked an issue Jul 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add code coverage to the workflow Upload pytest coverage to GitHub from the latest Python CI job Jul 25, 2026
Copilot AI requested a review from hspaans July 25, 2026 20:56
@hspaans
hspaans marked this pull request as ready for review July 25, 2026 20:59
Copilot AI review requested due to automatic review settings July 25, 2026 20:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub-native code coverage reporting to the CI workflow by generating a Cobertura (coverage.xml) report from the pytest run on the latest Python version in the matrix and uploading it to GitHub.

Changes:

  • Grants the tox job code-quality: write permission to authorize coverage uploads.
  • Extends pytest options for the 3.14 matrix run to emit coverage.xml.
  • Uploads coverage.xml via actions/upload-code-coverage@v1, gated to Python 3.14.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines +54 to +60
- name: Upload code coverage report
if: matrix.py == '3.14'
uses: actions/upload-code-coverage@v1
with:
file: coverage.xml
language: Python
label: code-coverage/pytest
@hspaans

hspaans commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Code Quality uploads aren't currently supported for personal repositories. Closing issue until support is available.

@hspaans hspaans closed this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add code coverage to the workflow

3 participants