Files
app/.gitea/workflows/test-backend.yml
T
stroblme 03670c782f Backend CI tests on Python 3.12 and 3.14, with the extras installed
A matrix of the declared floor and the newest release in place of 3.13
alone. The job now syncs --all-extras like `make test-backend`, since the
mail, MQTT and Influx tests fail on a fresh venv without the server extra.
Both packages list 3.14 among their classifiers.
2026-10-15 15:56:59 +02:00

73 lines
2.8 KiB
YAML

name: Test Backend
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
# A new push supersedes the run still queued for the commit before it. Without
# this each commit leaves its own run in the queue and a runner that was offline
# for a while works through a backlog of results nobody will read.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# The compose files live in docker/, so a bare `docker compose` from the repo
# root finds nothing. With COMPOSE_FILE set, compose reads .env from the
# working directory — the same file the backend settings load as ../.env.
# compose.ci.yml drops the fixed container_names and the fixed 5432 — both
# daemon-global, so without it a second run on the same host cannot start.
COMPOSE_FILE: docker/compose.yml:docker/compose.dev.yml:docker/compose.ci.yml
jobs:
test-backend:
runs-on: ubuntu-latest
# The floor `requires-python` declares and the newest release, so neither
# end of the supported range goes untested.
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.14"]
env:
# Per run, so the `down -v` steps reach neither a dev stack nor a run
# still going. Unique names cannot be recycled, hence the always-on
# teardown below.
COMPOSE_PROJECT_NAME: fluksio-app-ci-backend-${{ github.run_id }}
# uv would otherwise take a managed interpreter it already has over the
# one set up below.
UV_PYTHON: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: |
pyproject.toml
backend/pyproject.toml
uv.lock
# The extras too, as `make test-backend` does: the mail, MQTT and Influx
# tests import what only the `server` extra installs.
- run: uv sync --all-extras
# Nothing to start: the suite names its own SQLite file in a temp
# directory (backend/tests/__init__.py), the mail paths are patched, and
# the flow engine falls back to in-memory state without a Redis host.
- name: Run tests with coverage
run: uv run bash scripts/test.sh "Coverage for ${{ github.sha }}"
working-directory: backend
- name: Check the wheels build
# Cheap, and it catches a data file that stopped being packaged —
# alembic's revisions and the email templates ride along by directory.
run: |
uv build --all-packages --out-dir dist
uv run --no-project --with dist/fluksio_worker-*.whl fluksio-worker --help