mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-13 04:59:59 +02:00
Re-use docker-compose in Github Actions
This commit is contained in:
parent
f0a9866e0d
commit
3c32530082
1 changed files with 3 additions and 36 deletions
39
.github/workflows/test.yaml
vendored
39
.github/workflows/test.yaml
vendored
|
@ -36,52 +36,19 @@ jobs:
|
||||||
|
|
||||||
python-test:
|
python-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services: &service-dependencies # store this block to use it again
|
|
||||||
postgres:
|
|
||||||
image: postgres
|
|
||||||
env:
|
|
||||||
POSTGRES_DB: app
|
|
||||||
POSTGRES_USER: user
|
|
||||||
POSTGRES_PASSWORD: feedabee
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up python and dependencies
|
|
||||||
uses: ./.github/actions/setup-project
|
|
||||||
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
working-directory: ./src
|
working-directory: ./src
|
||||||
env:
|
run: docker compose run app python manage.py test
|
||||||
PYTHONUNBUFFERED: yup
|
|
||||||
DATABASE_URL: postgres://user:feedabee@localhost/app
|
|
||||||
DJANGO_SETTINGS_MODULE: registrar.config.settings
|
|
||||||
DJANGO_SECRET_KEY: feedabee
|
|
||||||
DJANGO_DEBUG: True
|
|
||||||
run: ./manage.py test
|
|
||||||
|
|
||||||
pa11y-scan:
|
pa11y-scan:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services: *service-dependencies # repeat service description from above
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up python and dependencies
|
|
||||||
id: setup
|
|
||||||
uses: ./.github/actions/setup-project
|
|
||||||
|
|
||||||
- uses: ./.github/actions/run-server
|
|
||||||
with:
|
|
||||||
database_url: ${{ steps.setup.outputs.database_url }}
|
|
||||||
|
|
||||||
- name: Accessibility Scan
|
- name: Accessibility Scan
|
||||||
working-directory: ./src
|
working-directory: ./src
|
||||||
run: npm run pa11y-ci
|
# leverage the docker compose setup that we already have for local development
|
||||||
|
run: docker compose run pa11y npm run pa11y-ci
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue