Skip to content

Commit

Permalink
Setup test database for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
normade committed Jan 6, 2025
1 parent 5b2df8c commit a06caa4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,23 @@ jobs:
pip install -U pip
pip install -r requirements/dev.txt
- name: Set DATABASE_URL
run: echo "DATABASE_URL=postgres://postgres:postgres@localhost:5432/modernism" >> $GITHUB_ENV

- name: Run Pytest
run: |
source venv/bin/activate
PYTHONPATH=$PYTHONPATH:app/ pytest --maxfail=1 --exitfirst
postgres:
image: postgres:14
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: modernism
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5

0 comments on commit a06caa4

Please # to comment.