49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: python-ci
|
|
|
|
trigger:
|
|
event: [ push, pull_request ]
|
|
|
|
steps:
|
|
- name: setup+deps
|
|
image: python:3.14-slim
|
|
environment:
|
|
UV_NO_SYNC_PROGRESS: "1"
|
|
commands:
|
|
- python -V
|
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
- export PATH="$HOME/.local/bin:$PATH"
|
|
# pick python version (use .python-version if present, else 3.12)
|
|
- PYVER="$( [ -f .python-version ] && cat .python-version || echo 3.12 )"
|
|
- uv python install "$PYVER"
|
|
- uv venv .venv
|
|
- . .venv/bin/activate
|
|
# install project + dev tools
|
|
- |
|
|
if [ -f pyproject.toml ] && grep -q "\[tool\.uv\]" pyproject.toml; then
|
|
uv sync --all-extras --dev
|
|
else
|
|
uv pip install -e ".[dev]" || true
|
|
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi
|
|
fi
|
|
- uv pip install pytest pytest-cov mypy ruff
|
|
|
|
- name: lint-typecheck
|
|
image: python:3.14-slim
|
|
commands:
|
|
- export PATH="$HOME/.local/bin:$PATH"
|
|
- . .venv/bin/activate
|
|
- ruff check .
|
|
- mypy --ignore-missing-imports .
|
|
|
|
- name: test
|
|
image: python:3.14-slim
|
|
commands:
|
|
- export PATH="$HOME/.local/bin:$PATH"
|
|
- . .venv/bin/activate
|
|
- pytest -q --maxfail=1 --disable-warnings --cov --cov-report=term-missing
|
|
|