Files
stack/.woodpecker/ci.yml
kert 6486cd22dd
All checks were successful
ci/woodpecker/push/infra-ci Pipeline was successful
ci/woodpecker/pr/infra-ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
coverage 99% coverage
ci/woodpecker/pr/ci Pipeline was successful
uv hygiene: build-system, uv.toml, version pins, auto-recovery hook
## [build-system] + drop uv pip install -e . (#58)
Add `[build-system] requires=["uv_build"] build-backend="uv_build"`
so `uv sync --dev` installs the project editably in one step.
Remove `uv pip install -e .` and `uv python pin 3.13.11` from CI.

## uv.toml with link-mode=copy (#60)
Create project-level `uv.toml` with `link-mode = "copy"` and
`python-preference = "managed"`. Prevents .venv symlinks from
pointing to /root/ when uv runs under different users.

## Align python version (#59)
`.python-version` pinned to `3.13` (minor, let patch float) instead
of platform-specific `cpython-3.13.12-linux-x86_64-gnu`. Removed
the CI step that downgraded to 3.13.11.

## Pre-commit auto-recovery (#61)
Hook now checks `uv run python -c 'import sys'` at the top — if the
venv is broken, it runs `uv sync --dev` automatically before checks.

## .gitignore
Add `.venv/` to prevent accidental venv commits.

fix #58, fix #59, fix #60, fix #61
2026-03-21 15:15:17 -04:00

55 lines
1.7 KiB
YAML

# ── Quality gate ─────────────────────────────────────────────────
# Runs on every push and PR. Must pass before merge to main.
# Gitea branch protection requires this pipeline's status checks.
when:
- event: [push, pull_request, manual]
steps:
- name: lint
image: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
environment:
UV_PYTHON_PREFERENCE: only-system
UV_LINK_MODE: copy
UV_PROJECT_ENVIRONMENT: .venv
commands:
- uv sync --dev
- uv run ruff check src/ tests/ --output-format=concise
- uv run ruff format --check src/ tests/
- name: test
image: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
environment:
UV_PYTHON_PREFERENCE: only-system
UV_LINK_MODE: copy
UV_PROJECT_ENVIRONMENT: .venv
commands:
- uv run pytest tests/ --cov=src --cov-report=term-missing --cov-fail-under=99 -q 2>&1 | tee pytest.out
- uv run python dev/scripts/coverage_badge.py < pytest.out > coverage.svg
depends_on:
- lint
- name: coverage-badge
image: ghcr.io/astral-sh/uv:python3.13-bookworm-slim
failure: ignore
environment:
UV_PYTHON_PREFERENCE: only-system
UV_LINK_MODE: copy
UV_PROJECT_ENVIRONMENT: .venv
GITEA_TOKEN:
from_secret: gitea_token
GITEA_URL:
from_secret: gitea_url
commands:
- uv run python dev/scripts/coverage_badge.py --post pytest.out
- uv run python dev/scripts/coverage_badge.py --upload coverage.svg
depends_on:
- test
- name: validate-compose
image: docker:cli
volumes:
- /run/user/1000/docker.sock:/var/run/docker.sock
commands:
- docker compose config --quiet