-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (73 loc) · 2.43 KB
/
ci.yaml
File metadata and controls
80 lines (73 loc) · 2.43 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
name: CI
on:
push:
branches: [main, master, v2]
pull_request:
branches: [main, master]
# Every PR must pass ALL four gates before merge is allowed.
# Repository Settings > Branches > Branch protection rules should require:
# - "lint", "typecheck", "test", "catalog-validation" to pass
# - At least 1 approving review (from CODEOWNERS / maintainers)
jobs:
lint:
name: "Gate 1: Lint & Format"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install ruff
- run: ruff check src/ tests/
- run: ruff format --check src/ tests/
typecheck:
name: "Gate 2: Type Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install ".[dev]"
- run: mypy src/agstack_pnd/ --ignore-missing-imports
test:
name: "Gate 3: Tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- run: pytest tests/ -v --tb=short --strict-markers
catalog-validation:
name: "Gate 4: Catalog & FATFD Integrity"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- name: Validate threat catalog schema
run: python -c "from agstack_pnd.catalog.loader import list_threats; t = list_threats(); print(f'Catalog OK: {len(t)} threats loaded')"
- name: Validate model UUID uniqueness
run: python -c "
from agstack_pnd.foundation.model_registry import ModelRegistry
r = ModelRegistry(); r._discover()
uuids = [str(c.metadata.uuid) for c in r._models.values()]
assert len(uuids) == len(set(uuids)), 'Duplicate UUIDs found'
print(f'Registry OK: {len(uuids)} unique models')
"
- name: Run FATFD validator
run: python .audit/validate_fatfd.py
docs:
name: "Docs Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[docs]"
- run: sphinx-build -b html docs/sphinx docs/_build