Files
app/.gitea/workflows/test-backend.yml
T

61 lines
2.1 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
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:
# 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