Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Python CI

Complete Python CI pipeline — linting, testing, and coverage in a single step.

Features

  • Ruff or flake8 linting (configurable)
  • Pytest with optional coverage reporting
  • Coverage threshold enforcement
  • Pip caching for faster runs
  • Flexible dependency installation (requirements.txt, pyproject.toml, or inline)

Usage

- uses: actions/checkout@v4
- uses: bertrandmbanwi/github-actions/python-ci@v1
  with:
    python-version: "3.12"
    linter: ruff
    source-dir: src
    install-project: "true"
    coverage-threshold: "80"

With requirements file

- uses: actions/checkout@v4
- uses: bertrandmbanwi/github-actions/python-ci@v1
  with:
    requirements-file: requirements-dev.txt
    test-args: "--tb=short -q"

Inputs

Input Required Default Description
python-version No 3.12 Python version
linter No ruff ruff or flake8
source-dir No . Directory to lint
test-command No pytest Test runner command
test-args No Extra test arguments
coverage-threshold No 0 Min coverage % (0 = disabled)
extra-deps No Additional pip packages
requirements-file No Path to requirements file
install-project No false Run pip install -e '.[dev]'

Outputs

Output Description
lint-passed true or false
tests-passed true or false
coverage-percent Coverage percentage or n/a