-
Notifications
You must be signed in to change notification settings - Fork 14
241 lines (200 loc) · 7.06 KB
/
Copy pathci.yml
File metadata and controls
241 lines (200 loc) · 7.06 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
# CI - 单元测试
# 在 PR 和 push 到 main 时运行所有包的单元测试
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Bay 单元测试 ──────────────────────────────────────────
test-bay:
name: "Bay Unit Tests"
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/bay
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pkgs/bay/uv.lock"
- name: Install dependencies
run: uv sync --frozen
- name: Unit tests
run: uv run pytest tests/unit -v --tb=short
# ── Gull 单元测试 ─────────────────────────────────────────
test-gull:
name: "Gull Unit Tests"
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/gull
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pkgs/gull/uv.lock"
- name: Install dependencies
run: uv sync --frozen
- name: Unit tests
run: uv run pytest tests/unit -v --tb=short
# ── Ship 单元测试 ─────────────────────────────────────────
test-ship:
name: "Ship Unit Tests"
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/ship
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pkgs/ship/uv.lock"
- name: Install dependencies
run: uv sync --frozen --extra test
- name: Unit tests
run: uv run pytest tests/unit -v --tb=short -m unit
# ── SDK 测试 ──────────────────────────────────────────────
test-sdk:
name: "SDK Tests"
runs-on: ubuntu-latest
defaults:
run:
working-directory: shipyard-neo-sdk
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "shipyard-neo-sdk/uv.lock"
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: Unit tests
run: uv run pytest tests -v --tb=short
# ── MCP 测试 ──────────────────────────────────────────────
test-mcp:
name: "MCP Tests"
runs-on: ubuntu-latest
defaults:
run:
working-directory: shipyard-neo-mcp
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "shipyard-neo-mcp/uv.lock"
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: Unit tests
run: uv run pytest tests -v --tb=short
# ── Browser contract smoke (integration/e2e) ─────────────────────────────
test-browser-contract:
name: "Browser Contract Smoke"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: |
pkgs/gull/uv.lock
pkgs/bay/uv.lock
- name: Install Gull dependencies
working-directory: pkgs/gull
run: uv sync --frozen
- name: Install Bay dependencies
working-directory: pkgs/bay
run: uv sync --frozen
- name: Run P0 browser contract unit tests
run: |
uv run --project pkgs/gull pytest pkgs/gull/tests/unit/test_runner.py -v --tb=short
uv run --project pkgs/bay pytest \
pkgs/bay/tests/unit/adapters/test_gull_adapter.py \
pkgs/bay/tests/unit/api/test_capabilities_browser_exec_batch_contract.py \
-v --tb=short
- name: Build local runtime images for browser e2e
run: |
docker build -t ship:latest pkgs/ship
docker build -t gull:latest pkgs/gull
- name: Run key P1 Gull batch integration tests
working-directory: pkgs/gull
run: uv run pytest tests/integration/test_gull_api.py::TestBatchExec -v --tb=short
- name: Prepare Bay e2e config
run: |
cat > /tmp/bay-e2e-config.yaml <<'YAML'
server:
host: "127.0.0.1"
port: 8001
security:
api_key: "e2e-test-api-key"
allow_anonymous: false
driver:
type: docker
docker:
connect_mode: host_port
host_address: "127.0.0.1"
publish_ports: true
profiles:
- id: python-default
image: ship:latest
runtime_type: ship
runtime_port: 8123
capabilities: [filesystem, shell, python]
idle_timeout: 1800
- id: browser-python
containers:
- name: ship
image: ship:latest
runtime_type: ship
runtime_port: 8123
capabilities: [python, shell, filesystem]
primary_for: [filesystem, python, shell]
- name: browser
image: gull:latest
runtime_type: gull
runtime_port: 8115
capabilities: [browser]
primary_for: [browser]
idle_timeout: 1800
YAML
- name: Start Bay API for e2e
working-directory: pkgs/bay
run: |
BAY_CONFIG_FILE=/tmp/bay-e2e-config.yaml \
uv run uvicorn app.main:create_app --factory --host 127.0.0.1 --port 8001 > /tmp/bay-e2e.log 2>&1 &
echo $! > /tmp/bay-e2e.pid
for i in $(seq 1 60); do
if curl -sf http://127.0.0.1:8001/health >/dev/null; then
exit 0
fi
sleep 1
done
echo "Bay failed to start within 60s"
cat /tmp/bay-e2e.log || true
exit 1
- name: Run key P1 Bay browser failure-path e2e
working-directory: pkgs/bay
env:
E2E_BAY_PORT: "8001"
E2E_API_KEY: "e2e-test-api-key"
run: |
uv run pytest \
tests/integration/core/test_browser_skill_e2e.py::test_browser_exec_batch_failure_keeps_response_history_trace_consistent \
-v --tb=short
- name: Dump Bay logs on failure
if: failure()
run: cat /tmp/bay-e2e.log || true
- name: Stop Bay API
if: always()
run: |
if [ -f /tmp/bay-e2e.pid ]; then
kill $(cat /tmp/bay-e2e.pid) || true
fi