-
Notifications
You must be signed in to change notification settings - Fork 14
45 lines (40 loc) · 1.09 KB
/
tests.yml
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
name: Test app
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
django-version: ["4.2", "5.1"]
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
ports:
- 5432:5432
# Add a health check to ensure postgres is ready
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
DJANGO_VERSION: ${{ matrix.django-version }}
run: |
uv sync --frozen
uv add "Django>${DJANGO_VERSION}"
- name: Run tests on python ${{ matrix.python-version }}
run: uv run pytest