-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (70 loc) · 2.06 KB
/
ci.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: 🔮 CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
PYTHONPATH: .
DJANGO_SETTINGS_MODULE: config.settings.test
CPUCOUNT: 1
PGPASSWORD: password
PGHOST: localhost
PGUSER: postgres
services:
minio:
image: bitnami/minio
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
postgres:
# Docker Hub image
image: postgres:15-alpine
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: 💾 Create a database to check migrations
run: |
psql <<SQL
CREATE DATABASE communaute;
SQL
- name: 💂 Install Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: pip
cache-dependency-path: requirements/dev.txt
- name: 📥 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
- name: ✨ Black, ruff & djlint
run: make quality
- name: 🚧 create cache table
run: python manage.py createcachetable
- name: 🚧 collect static for testing purposes
run: |
python manage.py collectstatic
python manage.py compress
- name: 🚧 compile translations
run: |
sudo apt-get install -y gettext
python manage.py compilemessages
- name: 🚧 Check pending migrations
run: python manage.py makemigrations --check --dry-run --noinput
- name: 🚧 Configure bucket
run: python manage.py configure_bucket
- name: 🤹 Django tests
run: pytest --numprocesses=logical --create-db
env:
DJANGO_DEBUG: True