Model/.github/workflows/ddd_tests.yml
2026-06-02 15:31:42 +00:00

32 lines
1 KiB
YAML

name: Run DDD tests
on:
pull_request:
branches:
- "**"
# The DDD rewrite (tests/) defines SQLModel table classes that map to the same
# physical tables as the legacy backend models. Both sets share the one global
# SQLModel.metadata, so they cannot be imported into the same pytest process —
# hence this runs as a separate workflow from unit_tests.yml until the legacy
# models are retired. It also covers the Lambda packaging linter
# (tests/test_lambda_packaging.py). Its DB is spawned in-process by
# pytest-postgresql, so no `services: postgres` and no env secrets are required,
# and it runs independently of (and in parallel with) the legacy unit tests.
jobs:
ddd-tests:
name: DDD tests (Docker)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build test image
run: docker build -f Dockerfile.test -t model-test .
- name: Run DDD tests
run: |
docker run --rm \
--network host \
model-test pytest -vv tests/