-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (102 loc) · 3.26 KB
/
ci.yml
File metadata and controls
116 lines (102 loc) · 3.26 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
name: Fleet CI
on:
push:
branches: [main, dev]
paths: ['fleet/**', 'tests/**', '.github/workflows/ci.yml']
pull_request:
branches: [main]
paths: ['fleet/**', 'tests/**', '.github/workflows/ci.yml']
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
smoke-test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.12']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install httpx anthropic
pip install flask psutil
pip install paho-mqtt playwright
pip install fastmcp tomli
pip install pytest pytest-asyncio
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Create fleet.toml (if missing)
working-directory: fleet
run: |
python -c "from pathlib import Path; p=Path('fleet.toml'); p.exists() or None"
- name: Run smoke tests (fast mode)
working-directory: fleet
run: python smoke_test.py --fast
env:
FLEET_TEST_DB: ":memory:"
- name: Run unit tests (pytest)
working-directory: fleet
run: python -m pytest ../tests/ -v --tb=short -x
env:
FLEET_TEST_DB: ":memory:"
- name: Verify skill imports
working-directory: fleet
run: |
python -c "
import importlib, sys, pathlib
sys.path.insert(0, '.')
skills_dir = pathlib.Path('skills')
failures = []
count = 0
for f in sorted(skills_dir.glob('*.py')):
if f.name.startswith('_'): continue
count += 1
try:
importlib.import_module(f'skills.{f.stem}')
except Exception as e:
failures.append(f'{f.stem}: {e}')
print(f'{count - len(failures)}/{count} skills imported')
if failures:
for f in failures: print(f' FAIL: {f}')
sys.exit(1)
"
- name: Verify CLI commands
working-directory: fleet
run: |
python lead_client.py status || true
python lead_client.py detect-cli
syntax-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check Python syntax (all .py files)
run: |
python -c "
import ast, sys, pathlib
errors = []
for f in pathlib.Path('.').rglob('*.py'):
if '.venv' in str(f) or 'node_modules' in str(f): continue
try:
ast.parse(f.read_text(encoding='utf-8'))
except SyntaxError as e:
errors.append(f'{f}: {e}')
if errors:
for e in errors: print(e)
sys.exit(1)
print(f'All .py files pass syntax check')
"
- name: Lint with ruff
run: |
pip install ruff
ruff check fleet/ --select E,W,F
continue-on-error: true