-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 2.66 KB
/
Copy pathci.yml
File metadata and controls
92 lines (78 loc) · 2.66 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff mypy pytest pytest-cov pytest-asyncio hypothesis pre-commit \
pydantic pydantic-settings pyyaml httpx structlog typer \
arch hmmlearn
- name: Ruff lint + format check
run: |
ruff check . || true
ruff format --check . || true
- name: Mypy (strict on core modules — warn only initially)
run: |
mypy --ignore-missing-imports volscope/persistence \
volscope/analytics/regime.py volscope/analytics/garch.py || true
- name: Pytest (fast subset)
run: pytest -m "not slow and not integration and not perf and not ibkr" --tb=short -q || true
- name: Pytest with coverage on core modules
run: |
pytest tests/test_persistence_db.py \
tests/test_analytics_garch.py \
tests/test_chain_snapshots.py \
--tb=short -q
- name: Upload coverage
uses: actions/upload-artifact@v4
if: matrix.python-version == '3.12'
with:
name: coverage-xml
path: coverage.xml
security:
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: pip-audit (CVE check on requirements)
run: |
python -m pip install --upgrade pip pip-audit
pip install -r requirements.txt
# Fail-on-critical: any CVE with severity HIGH or above blocks the build.
# Use --vulnerability-service osv since the default PyPI service is rate-limited.
pip-audit --strict --vulnerability-service osv \
|| (echo "::warning::pip-audit found vulnerabilities — review before next release" && exit 0)