diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 80b85bc8..724f5f95 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,9 +2,9 @@ name: Django CI on: push: - branches: [ main, add-pr-github-actions ] + branches: [ main ] pull_request: - branches: [ main, add-pr-github-actions ] + branches: [ main ] jobs: build: @@ -61,3 +61,8 @@ jobs: with: build: poetry run ./manage.py migrate --noinput start: poetry run ./manage.py runserver + - name: Run Unit Tests + env: + DATABASE_URL: postgresql://govuk_domain:govuk_domain@localhost:5432/govuk_domain + run: | + poetry run python manage.py test -v 2 diff --git a/Makefile b/Makefile index 4ab6d732..af3f9809 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,6 @@ migrate-devserver: clear-db: docker compose down && docker container prune -f && docker volume rm domains-register-a-govuk-domain_postgres-data + +test: + docker compose run --rm --service-ports --entrypoint "python manage.py test -v 2" web