-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (91 loc) · 3.04 KB
/
Copy pathci.yml
File metadata and controls
102 lines (91 loc) · 3.04 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
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
lint-and-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff
- name: Lint (ruff)
run: ruff check --exclude .venv --exclude data .
- name: Import & syntax check
run: |
python -c "
import ast, os
errors = []
for dirpath, _dirs, files in os.walk('.'):
if '/.venv' in dirpath or '/.git' in dirpath:
continue
for f in files:
if f.endswith('.py'):
p = os.path.join(dirpath, f)
try:
ast.parse(open(p).read())
except SyntaxError as e:
errors.append(f'{p}: {e}')
if errors:
for err in errors:
print(err)
raise SystemExit(1)
print('syntax ok')
"
- name: Tool discovery smoke test (no API keys required)
run: |
python -c "
from engine.tools import registry, discover_tools
discover_tools()
names = registry.names()
assert len(names) >= 7, f'expected 7+ tools, got {names}'
print(f'{len(names)} tools registered: {names}')
"
- name: Core module import smoke test
run: |
python -c "
from engine import CuriosityEngine
from engine.graph import build_graph, graph_summary
from engine.embeddings import cosine, find_similar
from providers import ModelProfile, build_client, build_embedding_client
from config import CuriosityEngineConfig
from journal import Journal
from models import EngineConfig, JournalEntry, CrossReference, Insight, RegisterEntry, Prediction
print('all core imports ok')
"
- name: Calculator tool functional test
run: |
python -c "
from engine.tools import registry, discover_tools
discover_tools()
r = registry.execute('calculator', {'expression': 'sqrt(144) + npv(0.1, [-1000, 300, 400, 500])'})
assert not r.is_error, r.content
assert '= -9.036814425' in r.content, r.content
print('calculator ok:', r.content.split(chr(10))[0])
"
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: curiosity-engine:ci
cache-from: type=gha
cache-to: type=gha,mode=max