-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (51 loc) · 1.58 KB
/
Copy pathci.yml
File metadata and controls
54 lines (51 loc) · 1.58 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"
- run: uvx pre-commit run --all-files
test:
runs-on: ubuntu-latest
services:
postgres:
image: pgvector/pgvector:pg17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: cs_assistant_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# TEST_DATABASE_URL must contain "test" and differ from DATABASE_URL (conftest safety guard).
# DATABASE_URL is required by Settings but never connected to during tests.
TEST_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/cs_assistant_test
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/cs_assistant
# Remaining vars are required by Settings; tests don't connect to these services.
REDIS_URL: redis://localhost:6379/0
OLLAMA_URL: http://localhost:11434
OLLAMA_CHAT_MODEL: llama3.2:3b
OLLAMA_EMBEDDING_MODEL: nomic-embed-text
EMBEDDING_DIM: "768"
TOP_K: "3"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"
- run: uv sync --frozen
- run: uv run pytest