Skip to content

Setup test database for CI #3

Setup test database for CI

Setup test database for CI #3

Workflow file for this run

name: Run Tests

Check failure on line 1 in .github/workflows/run-tests.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/run-tests.yaml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: postgres
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Run Pytest
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10.16'
- name: Install Dependencies
run: |
python -m venv venv
source venv/bin/activate
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