Repository navigation
149 lines (123 loc) · 4.06 KB
/
Copy pathci.yml
File metadata and controls
149 lines (123 loc) · 4.06 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
name: CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
PYTHON_VERSION: "3.11"
jobs:
format:
name: Format check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit
- name: Run formatting hooks (black, isort)
run: SKIP=pydocstyle pre-commit run --all-files
- name: Run docstring check (pydocstyle)
# Advisory: large pre-existing numpy-style docstring backlog, tracked
# separately. Runs and reports, but does not block CI (like pyright/vulture).
continue-on-error: true
run: pre-commit run --all-files pydocstyle
type-check:
name: Type check and static analysis
runs-on: ubuntu-latest
env:
PYTHONPATH: ${{ github.workspace }}/src
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test,typecheck]
- name: Run flake8
run: python -m flake8 src
- name: Run pydocstyle
continue-on-error: true
run: python -m pydocstyle src/tnfr
- name: Run mypy
# Advisory analysis: reports findings without blocking CI.
continue-on-error: true
run: python -m mypy src/tnfr
- name: Run pyright
run: python -m pyright src/tnfr
continue-on-error: true
- name: Run vulture
run: python -m vulture --min-confidence 80 src tests
continue-on-error: true
tests:
name: Python ${{ matrix.python-version }} engine tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
env:
PYTHONPATH: ${{ github.workspace }}/src
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test,numpy,yaml,orjson]
- name: Run docstring lint
if: matrix.python-version == '3.11'
continue-on-error: true
run: python -m pydocstyle src/tnfr
- name: Verify foundation prerequisites before physical mapping
if: matrix.python-version == '3.11'
run: python scripts/check_research_prerequisites.py
- name: Collect the complete retained test inventory
if: matrix.python-version == '3.11'
run: python -m pytest tests --collect-only -q
- name: Run routine engine and API tests
if: matrix.python-version != '3.11'
run: python -m pytest -n 2 --dist loadfile --junitxml=test-results/pytest.xml
- name: Run routine engine and API tests with coverage
if: matrix.python-version == '3.11'
run: >-
python -m pytest -n 2 --dist loadfile
--cov=src --cov-report=term-missing
--cov-report=xml:test-results/coverage.xml
--junitxml=test-results/pytest.xml
- name: Retain test results
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest-python-${{ matrix.python-version }}
path: |
test-results/pytest.xml
test-results/coverage.xml
if-no-files-found: warn
retention-days: 14