-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.39 KB
/
python.yml
File metadata and controls
47 lines (44 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
name: Django tests
on: [push, pull_request]
jobs:
django-test:
runs-on: ubuntu-latest
services:
postgres_data:
image: postgres:14.5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions_data
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/github_actions_data"
SECRET_KEY: 1234567890
FTC_DB_URL: "postgresql://postgres:postgres@localhost:5434/github_actions_data"
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.7.19"
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: ruff
run: |
uv run ruff check .
uv run ruff format . --check
- name: Run migrations
run: |
uv run python manage.py migrate
uv run python manage.py collectstatic
- name: Test with django test
run: |
uv run pytest