Skip to content

Use ubuntu-24.04 as base test image #5

Use ubuntu-24.04 as base test image

Use ubuntu-24.04 as base test image #5

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Run Pytest
runs-on: ubuntu-24.04
services:
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
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