-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.11 KB
/
run-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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