-
-
Notifications
You must be signed in to change notification settings - Fork 12
222 lines (179 loc) · 5.9 KB
/
ci.yml
File metadata and controls
222 lines (179 loc) · 5.9 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio pytest-cov hypothesis pytest-benchmark pytest-xdist
- name: Install package
run: pip install -e .[all]
# 메모리 안전: pytest-xdist -n 2 로 worker 프로세스 분리
# 각 worker가 별도 프로세스라 Polars 네이티브 메모리가 격리됨
# CI runner 7GB+ 여유 → worker당 1500MB 한계 (안전 마진)
- name: Run tests (pytest-xdist parallel)
env:
DARTLAB_DATA_DIR: ${{ github.workspace }}/tests/fixtures
PYTEST_MEMORY_LIMIT_MB: "1900"
run: pytest tests/ -n 2 --dist loadfile --tb=short -m "not requires_data and not heavy" --benchmark-disable --ignore=tests/test_fixture_analysis_real.py --ignore=tests/test_fixture_credit_real.py --ignore=tests/test_fixture_review_real.py --cov=dartlab --cov-report=term-missing --cov-report=html --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage report
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: htmlcov/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install ruff
run: pip install ruff==0.11.6
- name: Lint check
run: ruff check src/dartlab/ tests/
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install ruff
run: pip install ruff==0.11.6
- name: Format check
run: ruff format --check src/dartlab/ tests/
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install package and pyright
run: |
python -m pip install --upgrade pip
pip install -e .[all]
pip install pyright
- name: Run pyright
run: pyright
continue-on-error: true
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Import smoke test
run: |
python -c "
import dartlab
from dartlab import Company
from dartlab.core.registry import getEntries
from dartlab.core.finance.ratios import calcRatios
from dartlab.analysis.financial.insight.grading import analyzePerformance
from dartlab.providers.dart.finance.mapper import AccountMapper
entries = getEntries()
print(f'dartlab imported OK, {len(entries)} registry entries')
"
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install package and pip-audit
run: |
python -m pip install --upgrade pip
pip install -e . pip-audit
- name: Run pip-audit
run: pip-audit --strict --desc on 2>&1 | tee audit-report.txt
continue-on-error: true
- name: Upload audit report
if: always()
uses: actions/upload-artifact@v5
with:
name: pip-audit-report
path: audit-report.txt
retention-days: 30
quality-gate:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install tools
run: pip install radon vulture
- name: Run quality gate
run: python scripts/audit/qualityGate.py
- name: Record quality history
if: github.ref == 'refs/heads/master'
run: python scripts/audit/qualityGate.py --record
- name: Upload quality history
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v5
with:
name: quality-history
path: scripts/audit/qualityHistory.jsonl
retention-days: 90
deps-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install package and deptry
run: |
python -m pip install --upgrade pip
pip install -e .[all] deptry
- name: Check dependency health
run: deptry src/dartlab/ --ignore DEP002,DEP003 --extend-exclude _reference
continue-on-error: true
notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Validate notebook syntax
run: python scripts/audit/validateNotebooks.py