-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (39 loc) · 1.43 KB
/
django.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
name: Django application
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
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
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11.1
- name: Install dependencies
run: pip install pip-tools && pip-sync && playwright install
- name: Check no missing migrations
run: python manage.py makemigrations --check --dry-run > /dev/null || { RETURN=$?; echo "makemigrations created some migrations, maybe you should run makemigrations and commit the change"; }
env:
SECRET_KEY: NOT_A_REAL_SECRET
DATABASE_URL: postgres://postgres:postgres@localhost/github_actions
- name: Run ruff
run: ruff check .
- name: Run ruff format
run: ruff format --check .
- name: Run DjHTML
run: find -name *.html -not -path "./venv/*" | xargs djhtml
- name: Run tests
run: pytest
env:
SECRET_KEY: NOT_A_REAL_SECRET
DATABASE_URL: postgres://postgres:postgres@localhost/github_actions