-
Notifications
You must be signed in to change notification settings - Fork 0
249 lines (215 loc) · 7.09 KB
/
Copy pathci.yml
File metadata and controls
249 lines (215 loc) · 7.09 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
PYTHONUTF8: "1"
jobs:
quality:
name: Quality
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Verify locked development environment
run: uv sync --locked --group dev
- name: Check version consistency
run: uv run python scripts/check_versions.py
- name: Lint repository
run: uv run python -m ruff check .
- name: Check source formatting
run: uv run python -m ruff format --check src/
- name: Run type checking
run: uv run python -m pyright
- name: Verify semantic contract schemas
run: uv run python scripts/generate_contract_schemas.py --check
- name: Capture runtime baseline evidence
run: uv run python examples/36_runtime_baseline.py
- name: Exercise semantic contract
run: uv run python examples/37_semantic_contract.py
tests:
name: Tests (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.12"
- "3.13"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Verify locked development environment
run: uv sync --locked --group dev
- name: Run test suite
run: uv run python -m pytest --strict-markers --tb=short
optional-extras:
name: Optional extra (${{ matrix.extra }})
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
- extra: core
sync-args: ""
imports: anycode
- extra: anthropic
sync-args: --extra anthropic
imports: anthropic anycode.providers.anthropic
- extra: openai
sync-args: --extra openai
imports: openai anycode.providers.openai
- extra: google
sync-args: --extra google
imports: google.genai anycode.providers.google
- extra: ollama
sync-args: --extra ollama
imports: httpx anycode.providers.ollama
- extra: bedrock
sync-args: --extra bedrock
imports: boto3 anycode.providers.bedrock
- extra: azure
sync-args: --extra azure
imports: openai anycode.providers.azure
- extra: telemetry
sync-args: --extra telemetry
imports: opentelemetry.sdk anycode.telemetry.tracer
- extra: persistence
sync-args: --extra persistence
imports: aiosqlite anycode.memory.sqlite_store
- extra: redis
sync-args: --extra redis
imports: redis anycode.memory.redis_store
- extra: tokens
sync-args: --extra tokens
imports: tiktoken anycode.context.tokenizer
- extra: vector
sync-args: --extra vector
imports: chromadb anycode.memory.chromadb_store
- extra: providers
sync-args: --extra providers
imports: anthropic openai google.genai httpx boto3 anycode.providers
- extra: mcp
sync-args: --extra mcp
imports: mcp anycode.mcp.client
- extra: cli
sync-args: --extra cli
imports: typer rich yaml anycode.cli.main
- extra: sandbox
sync-args: --extra sandbox
imports: daytona anycode.sandbox.daytona
- extra: sandbox-e2b
sync-args: --extra sandbox-e2b
imports: e2b anycode.sandbox.e2b
- extra: sandbox-modal
sync-args: --extra sandbox-modal
imports: modal anycode.sandbox.modal
- extra: sandbox-runloop
sync-args: --extra sandbox-runloop
imports: runloop_api_client anycode.sandbox.runloop
- extra: sandbox-vercel
sync-args: --extra sandbox-vercel
imports: vercel anycode.sandbox.vercel
- extra: sandbox-langsmith
sync-args: --extra sandbox-langsmith
imports: langsmith anycode.sandbox.langsmith
- extra: all
sync-args: --extra all
imports: anycode
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Sync isolated dependency set
run: uv sync --locked --no-dev ${{ matrix.sync-args }}
- name: Smoke-test imports
run: >-
uv run --no-sync python -c
"import importlib, sys; [importlib.import_module(name) for name in sys.argv[1:]]"
${{ matrix.imports }}
integration:
name: Integration services
runs-on: ubuntu-latest
timeout-minutes: 25
services:
redis:
image: redis:8-alpine
ports:
- 6380:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
chromadb:
image: chromadb/chroma:1.5.5
ports:
- 8100:8000
env:
CHROMA_HOST_ADDR: "0.0.0.0"
CHROMA_HOST_PORT: "8000"
options: >-
--health-cmd "bash -c 'exec 3<>/dev/tcp/127.0.0.1/8000'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 10s
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Verify locked development environment
run: uv sync --locked --group dev
- name: Verify service endpoints
run: >-
python -c
"import socket, urllib.request;
socket.create_connection(('localhost', 6380), timeout=5).close();
urllib.request.urlopen('http://localhost:8100/api/v2/heartbeat', timeout=10).read()"
- name: Run integration suite
run: uv run python -m pytest tests/integration -m integration --strict-markers --tb=short