diff --git a/.github/workflows/ddd_tests.yml b/.github/workflows/ddd_tests.yml new file mode 100644 index 00000000..85e318d5 --- /dev/null +++ b/.github/workflows/ddd_tests.yml @@ -0,0 +1,32 @@ +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/