-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (98 loc) · 3.79 KB
/
Copy pathci.yml
File metadata and controls
111 lines (98 loc) · 3.79 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
108
109
110
111
name: quality-gate
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
quality-gate:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
DATABASE_URL: postgresql+psycopg://ci_user:ci_pass@127.0.0.1:5432/ai_testcase_gen_ci
OPENAI_API_KEY: ollama
OPENAI_BASE_URL: http://127.0.0.1:11434/v1
LLM_MODEL_GEN: deepseek-r1:7b
KG_BACKEND: networkx
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest ruff
- name: Lint (critical rules)
run: |
python -m ruff check . --select E9,F63,F7,F82
- name: Unit tests (minimal regression set)
run: |
pytest -q tests/test_progress_callback.py tests/test_minimal_regression.py
- name: Compile check
run: |
python -m py_compile ui/main.py src/core/ingestion/ingestor.py src/core/generation/generator.py src/core/output/exporter.py
- name: Import check
run: |
python -c "import importlib; importlib.import_module('src.data.database'); print('src.data.database import ok')"
python -c "import importlib; importlib.import_module('ui.main'); print('ui.main import ok')"
- name: Linux deployment artifact check
run: |
python scripts/configure.py \
--profile linux \
--non-interactive \
--yes \
--db-host 127.0.0.1 \
--db-port 5432 \
--db-user ai_testcase_user \
--db-password change_me \
--db-name ai_testcase_gen \
--postgres-admin-user postgres \
--backend-port 8002 \
--frontend-port 5173 \
--openai-base-url http://127.0.0.1:11434/v1 \
--openai-api-key ollama \
--llm-model-gen deepseek-r1:7b \
--kg-backend networkx \
--install-dir /opt/ai_testcase_gen \
--frontend-dist-dir /var/www/ai_testcase_gen/frontend/dist \
--server-name ci.example.internal
test -f .env.production
test -f frontend/.env.production
test -f deploy/generated/ai-testcase-backend.service
test -f deploy/generated/ai-testcase-legacy-ui.service
test -f deploy/generated/nginx.production.conf
test -f deploy/generated/install_linux.sh
test -f deploy/generated/init_postgres.sh
test -f deploy/generated/check_ollama_model.sh
python - <<'PY'
from pathlib import Path
env_text = Path(".env.production").read_text(encoding="utf-8")
assert "DATABASE_URL=postgresql+psycopg://" in env_text
assert "KG_BACKEND=networkx" in env_text
service_text = Path("deploy/generated/ai-testcase-backend.service").read_text(encoding="utf-8")
assert "WorkingDirectory=/opt/ai_testcase_gen" in service_text
assert "--port 8002" in service_text
nginx_text = Path("deploy/generated/nginx.production.conf").read_text(encoding="utf-8")
assert "proxy_pass http://127.0.0.1:8002/;" in nginx_text
print("linux deployment artifacts ok")
PY
- name: Bash syntax check
run: |
bash -n scripts/*.sh
bash -n deploy/generated/*.sh
- name: Frontend build
working-directory: frontend
run: |
npm ci
npm run build