-
Notifications
You must be signed in to change notification settings - Fork 13
46 lines (42 loc) · 1.45 KB
/
no_forgoten_migrations.yaml
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
name: Make sure to run manage.py makemigrations if you change models
on: [pull_request]
permissions: read-all
jobs:
is-migration-diff-clean:
runs-on: ubuntu-latest
services:
postgres:
image: docker.io/postgres:15-bookworm
env:
POSTGRES_DB: nycmesh-dev
POSTGRES_USER: nycmesh
POSTGRES_PASSWORD: abcd1234
POSTGRES_PORT: 5432
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4
with:
python-version: '3.11'
- name: "Upgrade pip"
run: "pip install --upgrade pip"
- name: "Install package"
run: pip install ".[dev]"
- name: "You forgot to run manage.py makemigrations for model changes"
env:
DB_NAME: nycmesh-dev
DB_USER: nycmesh
DB_PASSWORD: abcd1234
DB_HOST: localhost
DB_PORT: 5432
DJANGO_SECRET_KEY: k7j&!u07c%%97s!^a_6%mh_wbzo*$hl4lj_6c2ee6dk)y9!k88
run: |
python src/manage.py makemigrations meshapi meshapi_hooks --dry-run # Run extra time for debug output
python src/manage.py makemigrations meshapi meshapi_hooks --dry-run | grep "No changes detected in apps"