-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (100 loc) · 2.68 KB
/
Copy pathci.yml
File metadata and controls
107 lines (100 loc) · 2.68 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main", "develop"]
jobs:
lint-and-typecheck:
name: Lint & Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Lint
run: uv run ruff check .
- name: Type Check
run: uv run mypy .
- name: Test Docker Build
run: docker build -t multai-back-test .
test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint-and-typecheck
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test_db
POSTGRES_PORT: 5432
POSTGRES_HOST: localhost
REDIS_HOST: localhost
REDIS_PORT: 6379
NATS_PORT: 4222
NATS_HOST: localhost
NATS_PASSWORD: dummy
NATS_USER: dummy
MINIO_API_PORT: 9000
MINIO_ROOT_USER: dummy
MINIO_ROOT_PASSWORD: dummy
MINIO_HOST: localhost
jwt_secret: test_secret
encryption_key: MPCSXH0IYfkp8JTpUNH0vUVyDlUeP6OKI8kz5iK54mw=
FACE_ENCRYPTION_KEY: test_face_encryption_key
FIREBASE_CREDENTIALS_PATH: dummy.json
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
nats:
image: nats:2.10-alpine
command: --user dummy --pass dummy
ports:
- 4222:4222
minio:
image: minio/minio:latest
env:
MINIO_ROOT_USER: dummy
MINIO_ROOT_PASSWORD: dummy
command: server /data
ports:
- 9000:9000
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Run Migrations
run: uv run alembic upgrade head
- name: Run Tests
run: uv run pytest tests/