-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (52 loc) · 1.61 KB
/
Copy pathci.yml
File metadata and controls
66 lines (52 loc) · 1.61 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on:
pull_request:
push:
branches: ["master"]
permissions:
contents: read
jobs:
django:
name: Django tests and checks
runs-on: ubuntu-latest
# DEBUG now fails closed (defaults to False) when DJANGO_DEBUG is unset.
# CI exercises the app in debug mode, matching local development, so opt in
# explicitly for every manage.py step below.
env:
DJANGO_DEBUG: "1"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
run: uv sync --frozen
- name: Run tests
run: uv run python manage.py test
- name: Start Postgres test service
env:
GOGGLES_ENV_FILE: .env.example
run: docker compose up -d --wait db-test
- name: Run tests against Postgres
env:
DATABASE_URL: postgres://goggles:goggles@127.0.0.1:55432/goggles_test
run: uv run python manage.py test
- name: Stop Postgres test service
if: always()
env:
GOGGLES_ENV_FILE: .env.example
run: docker compose rm -sf db-test
- name: Run Django system checks
run: uv run python manage.py check
- name: Run Ruff
run: uv run ruff check .
- name: Check Ruff formatting
run: uv run ruff format --check .
- name: Check migration drift
run: uv run python manage.py makemigrations --check --dry-run