-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (89 loc) · 3.33 KB
/
Copy pathci.yml
File metadata and controls
106 lines (89 loc) · 3.33 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
name: CI — Smoke Test, Lint, Security
on:
push:
branches: [main]
paths:
- '**.py'
- 'requirements.txt'
pull_request:
branches: [main]
paths:
- '**.py'
- 'requirements.txt'
permissions:
contents: read
jobs:
imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.11'
cache: pip
- name: Install dependencies
run: pip install --prefer-binary -r requirements.txt
- name: Core engine imports
run: |
python -c "
import sys
failures = []
checks = [
('data_providers', 'DataManager'),
('sml_engine', 'SMLEngine'),
('execution_engine', 'ExecutionEngine'),
('options_intelligence', 'OptionsIntelligence'),
('iwm_odte_engine', 'IwmOdteEngine'),
('gamma_flow_engine', 'GammaFlowEngine'),
('whale_stalker_engine', 'WhaleStalkerEngine'),
('discord_alerts', 'DiscordAlerts'),
('proof402_integration', 'require_payment'),
('x402_flask', 'x402_guard'),
]
for module, symbol in checks:
try:
mod = __import__(module)
getattr(mod, symbol)
print(f' OK {module}.{symbol}')
except Exception as e:
failures.append(f'FAIL {module}.{symbol}: {e}')
print(f'FAIL {module}.{symbol}: {e}', file=sys.stderr)
if failures:
sys.exit(1)
"
- name: Core app imports
run: |
python -c "
import sys, os
os.environ.setdefault('PROOF402_TOKEN_SECRET', 'ci-placeholder')
failures = []
checks = [
('core.state', 'GlobalState'),
('core.legacy', 'get_service'),
('core.oracle_engine', 'OracleEngine'),
('core.rdt_engine', 'RecurrentDepthTransformer'),
('core.market_graph', 'get_graph'),
('core.signal_history', 'record'),
('core.proprietary_ema_engine', '_Engine4'),
('core.proprietary_ema_engine', 'run_proprietary_suite'),
]
for module, symbol in checks:
try:
import importlib
mod = importlib.import_module(module)
getattr(mod, symbol)
print(f' OK {module}.{symbol}')
except Exception as e:
failures.append(f'FAIL {module}.{symbol}: {e}')
print(f'FAIL {module}.{symbol}: {e}', file=sys.stderr)
if failures:
sys.exit(1)
"
- name: Install security tools
run: pip install flake8 bandit safety
- name: Lint (warnings only)
run: flake8 core/ --max-line-length=120 --ignore=E501,W503 || true
- name: Security scan — bandit
run: bandit -r core/ -ll -q || true
- name: Dependency vulnerability check
run: safety check -r requirements.txt || true