Skip to content

Latest commit

 

History

History
157 lines (99 loc) · 7.1 KB

README.md

File metadata and controls

157 lines (99 loc) · 7.1 KB

Icon GitHub Action: Test Python

Test Python

Marketplace Release License Stars PRs Welcome

Overview

Run project-locked pytest with JUnit and Cobertura coverage.

Declare pytest and pytest-cov in the default uv dependency groups. Configure coverage sources in [tool.coverage.run] to avoid measuring unrelated code. A trusted Bash command replaces the default and must produce JUnit for test reporting and cobertura.xml for coverage. The common parser handles both formats.

Run setup-python first with the same working-directory.

coverage: "github" is the default. Set coverage: "codecov" and grant the job id-token: write for OIDC upload of cobertura.xml. An empty coverage value disables publication while retaining JUnit; collection is controlled by the command. Custom commands must produce the applicable report files.

Native reports survive command failures and are retained for seven days. See the continuous integration workflow for consolidated reporting and permissions.

Usage

- uses: hoverkraft-tech/ci-github-python/actions/test@4b801b911424c68370a3e713bc5404151ab4d772 # main
  with:
    # uv project directory.
    # Default: `.`
    working-directory: .

    # Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting.
    # Default: `uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml`
    command: uv run --locked pytest --junitxml=junit.xml --cov
      --cov-report=term-missing --cov-report=xml:cobertura.xml

    # Publication only: `github`, `codecov`, or empty. Collection is controlled by command.
    # Default: `github`
    coverage: github

    # Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted.
    report-group: ""

Inputs

Input Description Required Default
working-directory uv project directory. false .
command Trusted Bash test command. Configure measured packages in [tool.coverage.run]. Generate junit.xml and cobertura.xml for reporting. false uv run --locked pytest --junitxml=junit.xml --cov --cov-report=term-missing --cov-report=xml:cobertura.xml
coverage Publication only: github, codecov, or empty. Collection is controlled by command. false github
report-group Outer calling job ID for consolidated ci-reports. Defaults to the current job ID. No individual PR comments are posted. false -

Outputs

Output Description
report-artifact-id Native report artifact ID. Empty when no reports were produced.

Contributing

Contributions are welcome! Please see the contributing guidelines for more details.

License

This project is licensed under the MIT License.

SPDX-License-Identifier: MIT

Copyright © 2026 hoverkraft

For more details, see the license.


This documentation was automatically generated by CI Dokumentor.