-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2.09 KB
/
Copy pathci.yml
File metadata and controls
77 lines (67 loc) · 2.09 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra dev
- name: Run ruff lint
run: uv run ruff check .
- name: Run config test
env:
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
REDIS_URL: redis://localhost:6379
CHROMA_PERSIST_PATH: ./chroma_db
CONFIDENCE_THRESHOLD: "0.7"
CRITIC_PASS_THRESHOLD: "0.6"
MAX_REACT_ITERATIONS: "5"
APP_ENV: test
LOG_LEVEL: INFO
run: |
uv run python -c "from backend.config import settings; print('Config OK:', settings.app_env)"
- name: Run ChromaDB + tools tests
env:
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
REDIS_URL: redis://localhost:6379
CHROMA_PERSIST_PATH: ./chroma_db
CONFIDENCE_THRESHOLD: "0.7"
CRITIC_PASS_THRESHOLD: "0.6"
MAX_REACT_ITERATIONS: "5"
APP_ENV: test
LOG_LEVEL: INFO
run: |
uv run python scripts/ingest_faq.py
uv run python -c "
import sys
sys.path.insert(0, '.')
from backend.db.chroma import get_faq_collection, search_faq
c = get_faq_collection()
assert c.count() == 75, f'Expected 75, got {c.count()}'
results = search_faq('refund policy')
assert len(results) > 0, 'Search returned no results'
assert results[0]['topic'] == 'refund', f'Wrong topic: {results[0][\"topic\"]}'
print('ChromaDB tests passed')
"
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5