name: Test Backend on: push: branches: - main pull_request: types: - opened - synchronize 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 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 }} steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" - name: Set up uv uses: astral-sh/setup-uv@v7 with: cache-dependency-glob: | pyproject.toml backend/pyproject.toml uv.lock - run: uv sync # 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