-
Notifications
You must be signed in to change notification settings - Fork 22
52 lines (47 loc) · 1.39 KB
/
test.yml
File metadata and controls
52 lines (47 loc) · 1.39 KB
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
52
name: Tests
on:
- pull_request
jobs:
build:
runs-on: ubuntu-latest
name: Run tests
services:
postgres:
image: postgis/postgis:13-3.1-alpine
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Setup python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- run: uv sync --locked --all-extras
- run: createdb jedeschule_test
env:
PGHOST: localhost
PGPASSWORD: postgres
PGPORT: 5432
PGUSER: postgres
- run: |
set -e
echo "🏗 Running alembic migrations..."
uv run alembic upgrade head
echo "🧪 Running test_models.py..."
uv run python test_models.py
echo "🔎 Discovering and running unit tests..."
uv run python -m unittest discover -s test -p "*.py" -v
env:
DATABASE_URL: postgresql://postgres:postgres@0.0.0.0:5432/jedeschule_test