9
9
jobs :
10
10
quality-gate :
11
11
runs-on : ubuntu-latest
12
+ strategy :
13
+ matrix :
14
+ check : [lint, format-check, type-check, security, django-check, test]
15
+ fail-fast : false
12
16
13
- services :
14
- postgres :
15
- image : pgvector/pgvector:pg16
16
- env :
17
- POSTGRES_DB : genealogy_extractor
18
- POSTGRES_USER : postgres
19
- POSTGRES_PASSWORD : postgres
20
- options : >-
21
- --health-cmd pg_isready
22
- --health-interval 10s
23
- --health-timeout 5s
24
- --health-retries 5
25
- ports :
26
- - 5432:5432
27
-
28
- redis :
29
- image : redis:7-alpine
30
- options : >-
31
- --health-cmd "redis-cli ping"
32
- --health-interval 10s
33
- --health-timeout 5s
34
- --health-retries 5
35
- ports :
36
- - 6379:6379
37
-
38
17
steps :
39
18
- uses : actions/checkout@v4
40
19
41
- - name : Set up Python 3.12
42
- uses : actions/setup-python@v4
43
- with :
44
- python-version : ' 3.12'
45
-
46
- - name : Install system dependencies
47
- run : |
48
- sudo apt-get update
49
- sudo apt-get install -y \
50
- tesseract-ocr \
51
- tesseract-ocr-eng \
52
- tesseract-ocr-nld \
53
- libtesseract-dev \
54
- poppler-utils
55
-
56
- - name : Install Python dependencies
57
- run : |
58
- python -m pip install --upgrade pip
59
- pip install -r requirements.txt
60
-
61
20
- name : Set up environment variables
62
21
run : |
63
22
cat > .env << EOF
64
23
DJANGO_SECRET_KEY=test-secret-key-for-ci
65
24
DEBUG=False
66
- DB_HOST=localhost
25
+ DB_HOST=db
67
26
DB_NAME=genealogy_extractor
68
27
DB_USER=postgres
69
28
DB_PASSWORD=postgres
70
29
DB_PORT=5432
71
- REDIS_HOST=localhost
30
+ REDIS_HOST=redis
72
31
REDIS_PORT=6379
73
32
DJANGO_SUPERUSER_USERNAME=admin
74
33
DJANGO_SUPERUSER_PASSWORD=admin
75
34
DJANGO_SUPERUSER_EMAIL=admin@localhost
76
35
EOF
77
36
78
- - name : Run quality gate
79
- run : make quality-gate
37
+ - name : Build and start services
38
+ run : docker compose up -d --build
39
+
40
+ - name : Wait for services to be ready
41
+ run : |
42
+ echo "Waiting for services to be ready..."
43
+ sleep 15
44
+
45
+ - name : Run ${{ matrix.check }}
46
+ run : make ${{ matrix.check }}
0 commit comments