-
-
Notifications
You must be signed in to change notification settings - Fork 23
167 lines (159 loc) · 6.51 KB
/
Copy pathci.yml
File metadata and controls
167 lines (159 loc) · 6.51 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: test + lint (full offline stack)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install (core + server/mcp/code extras; no torch — the offline gate)
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Lint (ruff)
run: ruff check .
- name: Commercial manifest + strict-CSP drift gate
run: |
python scripts/check_commercial_manifest.py
python scripts/externalize_dashboard_assets.py
- name: Unit tests (full suite — extras-gated tests included)
run: python -m pytest tests/ -q
- name: Retrieval eval gate
run: python -m eval.harness --dataset eval/datasets/sample.jsonl --k 5
- name: Retrieval eval gate — CodeMem (coding-agent wedge, incl. conflict resolution)
run: python -m eval.harness --dataset eval/datasets/codemem.jsonl --k 5
- name: Ablation (vector-only vs hybrid)
run: python -m eval.ablation
core-py39:
name: core floor (numpy-only, Python 3.9)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.9"
- name: Install (numpy-only core — the minimum supported runtime)
run: |
python -m pip install --upgrade pip
pip install numpy pytest
- name: Unit tests (extras-gated tests skip; the core must pass)
run: python -m pytest tests/ -q
- name: Retrieval eval gate
run: python -m eval.harness --dataset eval/datasets/sample.jsonl --k 5
- name: Ablation
run: python -m eval.ablation
browser-accessibility:
name: browser accessibility smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "24"
- name: Install dashboard and browser test dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]" "uvicorn[standard]>=0.29"
npm ci
npx playwright install --with-deps chromium
- name: Playwright desktop/mobile, keyboard, CSP, console, and axe checks
run: npx playwright test
docker-gate:
# Keeps CI fast: the docker job always runs on push to main, but on PRs only
# when image/deployment paths changed (Dockerfile, entrypoint, Railway, source,
# pyproject.toml, or this workflow). No third-party actions — plain git diff.
name: docker smoke — path gate
runs-on: ubuntu-latest
outputs:
run: ${{ steps.decide.outputs.run }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- id: decide
run: |
if [ "${{ github.event_name }}" != "pull_request" ]; then
echo "run=true" >> "$GITHUB_OUTPUT"
elif git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" \
| grep -qE '^(Dockerfile|docker-entrypoint\.sh|docker-compose\.yml|railway\.json|deploy/|\.dockerignore|engraphis/|scripts/|pyproject\.toml|\.github/workflows/ci\.yml)'; then
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "run=false" >> "$GITHUB_OUTPUT"
fi
docker-smoke:
name: docker build + health smoke
runs-on: ubuntu-latest
needs: docker-gate
if: needs.docker-gate.outputs.run == 'true'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Build image
run: docker build -t engraphis:ci .
- name: Verify production image OCR runtime
run: >-
docker run --rm --entrypoint sh engraphis:ci -c
'python -c "import PIL, pytesseract" && command -v tesseract >/dev/null &&
tesseract --version | head -n 1'
- name: Audit the exact production image dependency set
run: >-
docker run --rm --entrypoint sh engraphis:ci -c
'python -m pip install --no-cache-dir pip-audit &&
python -m pip_audit --local'
- name: Run container (offline deterministic embedder — no model downloads)
run: |
docker run -d --name engraphis -p 8700:8700 \
-e ENGRAPHIS_EMBED_MODEL= \
-e ENGRAPHIS_LOOP_INTERVAL=0 \
-e ENGRAPHIS_HOST=0.0.0.0 \
-e ENGRAPHIS_SERVICE_MODE=customer \
engraphis:ci
- name: Wait for /api/health, then check /api/ready
run: |
for i in $(seq 1 60); do
code=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8700/api/health || true)
if [ "$code" = "200" ]; then
echo "healthy after ~${i}s"
curl -fsS http://127.0.0.1:8700/api/ready
exit 0
fi
sleep 1
done
echo "server never became healthy"
docker logs engraphis
exit 1
- name: Teardown
if: always()
run: docker rm -f engraphis
build:
name: build + install wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Build sdist + wheel and verify a clean install
run: |
python -m pip install --upgrade pip build pip-audit
python -m build
python -m venv .audit-venv
.audit-venv/bin/python -m pip install --upgrade "pip>=26.1.2" "setuptools>=83"
.audit-venv/bin/python -m pip install dist/*.whl
AUDIT_SITE=$(.audit-venv/bin/python -c "import site; print(site.getsitepackages()[0])")
python -m pip_audit --path "$AUDIT_SITE"
.audit-venv/bin/python -c "import engraphis; print('wheel import OK')"