diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..36e3312 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,51 @@ +# Woodpecker CI pipeline for the member portal — THIN on purpose. +# +# Runs the portal's EXISTING test suites (tests/test_*.py, one self-contained +# script per regression, each with its own "WHY THIS EXISTS" docstring). No +# test logic lives here; any change to what is tested belongs in tests/. +# +# Gating: `push` fires the suite on every push (including branch pushes), so a +# red run blocks the merge via Gitea branch protection (status check +# `ci/woodpecker/push/main`). `manual` is kept so a run can be triggered by +# hand from the Woodpecker UI or API. +# +# Backend note (why there are no container images here): +# The co-op's Woodpecker agent is a Cloudron app with no Docker socket, so it +# runs the `local` backend — each step executes as a shell command INSIDE the +# agent container and the step's `image:` field selects the SHELL, not a +# container image. Every tool a step needs must be baked into the agent image +# (co-op/woodpecker-agent): python3 + pip, node, bash, git, git-lfs. +# +# Dependency note (why not `-r requirements.txt`): +# The agent image's Python is 3.14, where the app image's PINNED stack has no +# published wheels (pydantic 2.9.2 / psycopg2-binary 2.9.9). The tests import +# app.main, which at import time needs only the bounded ranges below; the +# heavier runtime deps (uvicorn, psycopg2) are lazy-imported and unneeded by +# the suites. Ranges, not floating, so a future major cannot silently change +# what CI proves — a major bump shows up as a red run here first. + +when: + - event: push + - event: manual + +steps: + - name: tests + image: bash + commands: + # venv on the writable volume — the container rootfs is read-only and + # pip refuses to write /root/.local. + - python3 -m venv .venv + - .venv/bin/pip -q install 'fastapi>=0.115,<1' 'httpx>=0.27,<1' 'PyJWT>=2.9,<3' 'slowapi>=0.1.9,<1' 'cryptography>=44,<46' + # Run EVERY suite even when one fails, then fail the step — a single + # command chain would hide all failures after the first. + - | + fails=0 + for f in tests/test_*.py; do + echo "== $f" + .venv/bin/python "$f" || fails=$((fails+1)) + done + if [ "$fails" -ne 0 ]; then + echo "FAILED: $fails test file(s) red" + exit 1 + fi + echo "all portal test suites green"