-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (102 loc) · 4.67 KB
/
Copy pathci.yml
File metadata and controls
121 lines (102 loc) · 4.67 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
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
PYTHONUTF8: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Poppler installieren (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y poppler-utils
- name: Poppler installieren (macOS)
if: runner.os == 'macOS'
run: brew install poppler
- name: Poppler installieren (Windows)
if: runner.os == 'Windows'
run: choco install poppler -y --no-progress
# Retry-Schleife: uvs interne 3 HTTP-Retries reichen bei längeren Index-Ausfällen
# nicht (2026-07-06: download.pytorch.org ~2h unerreichbar von den Runnern, erster
# Lauf nach uv.lock-Änderung = Cache-Kaltstart → Install-Step rot ohne Code-Bezug).
- name: Abhängigkeiten installieren (uv, aus Lockfile)
shell: bash
run: |
for i in 1 2 3; do
uv sync --extra dev --locked --python 3.12 && exit 0
echo "uv sync Versuch $i fehlgeschlagen — warte $((i * 30))s"
sleep $((i * 30))
done
uv sync --extra dev --locked --python 3.12
# Format-Gate (gepinnte ruff-Version aus uv.lock; nur Formatierung, kein Lint/--fix)
- name: Ruff-Format-Check
run: uv run ruff format --check .
# Lint-Gate (seit #141 repo-weit sauber; Regelwerk in pyproject.toml)
- name: Ruff-Lint-Check
run: uv run ruff check .
# Nicht `pdftotext -v` direkt: Xpdf-basierte Windows-Builds exiten dabei non-zero
- name: pdftotext-Smoke-Test
run: uv run python -c "import shutil, sys; p = shutil.which('pdftotext'); print(p); sys.exit(0 if p else 1)"
- name: Packaging-Smoke-Test (Importe, Entry-Point, Package-Data)
run: |
uv run python -c "import generative, extractive, shared, decision_engine"
uv run python -c "import importlib.resources as r; assert r.files('generative').joinpath('tag_registry.yml').is_file()"
uv run atomic-notes --help
# Kanonische Suite (LLM-frei) + decision_engine + shared. extractive-Tests
# laufen hier bewusst nicht: brauchen den schweren GLiNER-Stack
# ([extractive]-Extra). shared/tests deckt den path_safety-Traversal-Schutz
# extra-frei ab (#155). Die modellfreien extractive-Tests laufen im
# separaten Job `extractive-unit` (nur ubuntu); die E2E-Tests wöchentlich
# in extractive-e2e.yml.
- name: Tests
run: uv run python -m pytest generative lib/decision_engine/tests shared/tests -q
# Modellfreie extractive-Tests (kein GLiNER-Download): decken u.a. den
# path_safety-Traversal-Schutz über den extractive-Adapter ab (#155). Nur
# ubuntu — der Stack ist plattformunabhängig, Dreifach-Matrix wäre Verschwendung.
extractive-unit:
runs-on: ubuntu-latest
env:
PYTHONUTF8: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
# Retry-Schleife analog zum test-Job (uvs interne HTTP-Retries reichen bei
# längeren Index-Ausfällen nicht). --extra dev liefert pytest, --extra
# extractive den NLP-Stack (pdfplumber/nltk/langdetect/sumy).
- name: Abhängigkeiten installieren (uv, extractive + dev)
shell: bash
run: |
for i in 1 2 3; do
uv sync --extra extractive --extra dev --locked --python 3.12 && exit 0
echo "uv sync Versuch $i fehlgeschlagen — warte $((i * 30))s"
sleep $((i * 30))
done
uv sync --extra extractive --extra dev --locked --python 3.12
# sentence_extractor tokenisiert zur Laufzeit über nltk punkt/punkt_tab —
# kleiner Download (~18 MB gezippt), NICHT das 500-MB-GLiNER-Modell. Pro Lauf
# neu (klein genug; Caching lohnt hier nicht, GLiNER-Cache siehe Weekly-E2E).
- name: nltk-Satztokenizer laden (punkt)
run: uv run python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
# Nur modellfrei: test_e2e.py ausgeschlossen (zieht das reale GLiNER-Modell).
- name: Extractive-Unit-Tests (modellfrei)
run: uv run python -m pytest tests/extractive -q --ignore=tests/extractive/test_e2e.py