Skip to content

Merge pull request #289 from co-cddo/feature/DEV_425-Filter-Sentry-tr… #914

Merge pull request #289 from co-cddo/feature/DEV_425-Filter-Sentry-tr…

Merge pull request #289 from co-cddo/feature/DEV_425-Filter-Sentry-tr… #914

Workflow file for this run

name: Integration tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
# Docker Hub image
image: postgres
env:
POSTGRES_DB: govuk_domain
POSTGRES_USER: govuk_domain
POSTGRES_PASSWORD: govuk_domain
ports:
- "5432:5432"
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
clamav:
# Docker Hub image
image: clamav/clamav:latest
ports:
- "3310:3310"
s3:
image: adobe/s3mock
env:
initialBuckets: registration-app-media-root-local
debug: "true"
retainFilesOnExit: "false"
ports:
- "9090:9090"
steps:
- name: Install pyenv and Python
run: |
curl https://pyenv.run | bash && \
export PYENV_ROOT="$HOME/.pyenv" && \
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" && \
eval "$(pyenv init -)" && \
pyenv update && \
pyenv install 3.10.11 && \
pyenv global 3.10.11 && \
pyenv rehash
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
python -m pip install --upgrade poetry pre-commit
poetry install --no-root
- name: Run linters
run: |
pre-commit run --all
- name: Init server
env:
SECRET_KEY: blah
DATABASE_URL: postgresql://govuk_domain:govuk_domain@localhost:5432/govuk_domain
DOMAIN_NAME: http://localhost:8010
run: |
poetry run ./manage.py collectstatic --noinput
poetry run ./manage.py migrate --noinput
poetry run ./manage.py create_reviewer_group
poetry run ./manage.py loaddata ./seed/users.json
poetry run ./manage.py create_sample_data
- name: Cypress
uses: cypress-io/github-action@v6
env:
SECRET_KEY: blah
DATABASE_URL: postgresql://govuk_domain:govuk_domain@localhost:5432/govuk_domain
DEBUG: True
DOMAIN_NAME: http://localhost:8010
AWS_ENDPOINT_URL_S3: http://127.0.0.1:9090
CLAMD_TCP_ADDR: 127.0.0.1
S3_STORAGE_ENABLED: "True"
AWS_ACCESS_KEY_ID: "dummy-key-id"
AWS_SECRET_ACCESS_KEY: "dummy-key"
ENVIRONMENT: 'local'
with:
start: |
/home/runner/work/domains-register-a-govuk-domain/domains-register-a-govuk-domain/.github/workflows/start-server.sh
- name: Run Unit Tests
env:
DATABASE_URL: postgresql://govuk_domain:govuk_domain@localhost:5432/govuk_domain
AWS_ENDPOINT_URL_S3: http://127.0.0.1:9090
CLAMD_TCP_ADDR: 127.0.0.1
S3_STORAGE_ENABLED: "True"
AWS_ACCESS_KEY_ID: "dummy-key-id"
AWS_SECRET_ACCESS_KEY: "dummy-key"
ENVIRONMENT: 'local'
NOMINET_ROMSID: test_romsid
NOMINET_SECRET: test_secret # pragma: allowlist secret
run: |
SECRET_KEY=unneeded DOMAIN_NAME=http://localhost:8010 poetry run python manage.py test -v 2