-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (76 loc) · 2.4 KB
/
Copy pathci.yml
File metadata and controls
81 lines (76 loc) · 2.4 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch: # manual trigger for the browser e2e job
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- run: uv sync --frozen
- name: ruff check
run: uv run ruff check src tests eval
- name: ruff format --check
run: uv run ruff format --check src tests eval
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --frozen
# Unit tests mock all external services (Neo4j, LLM APIs) — no containers needed.
- name: Run unit tests (e2e deselected)
run: uv run pytest tests/ -m "not e2e" --cov=src --cov-report=term-missing --cov-fail-under=60
# Browser e2e — manual only (heavy: browser install + live server). Uses the
# synthetic seed graph so the app renders without real data or API keys.
e2e:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
services:
neo4j:
image: neo4j:5-community
env:
NEO4J_AUTH: neo4j/prove
ports:
- 7687:7687
options: >-
--health-cmd "cypher-shell -u neo4j -p prove 'RETURN 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 20
env:
NEO4J_URI: bolt://localhost:7687
NEO4J_PASSWORD: prove
BASE_URL: http://localhost:7860
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- run: uv sync --frozen
- name: Install Playwright Chromium
run: uv run playwright install --with-deps chromium
- name: Seed demo graph
run: uv run python scripts/seed_demo.py --reset
- name: Start app
run: |
uv run uvicorn src.app:app --host 0.0.0.0 --port 7860 &
for i in $(seq 1 30); do
curl -fsS http://localhost:7860/healthz && break || sleep 2
done
- name: Run e2e (chromium; webkit/firefox auto-skip)
run: uv run pytest tests/e2e -m e2e -q