Complete Python CI pipeline — linting, testing, and coverage in a single step.
- 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)
- 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"
- uses: actions/checkout@v4
- uses: bertrandmbanwi/github-actions/python-ci@v1
with:
requirements-file: requirements-dev.txt
test-args: "--tb=short -q"
| 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]' |
| Output |
Description |
lint-passed |
true or false |
tests-passed |
true or false |
coverage-percent |
Coverage percentage or n/a |