Skip to content

Commit 6423ca8

Browse files
committed
release check pipe
1 parent 130bbdc commit 6423ca8

File tree

1 file changed

+210
-0
lines changed

1 file changed

+210
-0
lines changed

.github/workflows/release.yml

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
name: Release Testing
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
# ─────────────────────────────────────────────
11+
# 1. Unit + integration tests
12+
# ─────────────────────────────────────────────
13+
tests:
14+
name: Tests
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Install dependencies
24+
run: pip install -e ".[dev,tests]"
25+
26+
- name: Run tests
27+
run: pytest --tb=short -q
28+
29+
# ─────────────────────────────────────────────
30+
# 2. Build wheel
31+
# ─────────────────────────────────────────────
32+
build:
33+
name: Build wheel
34+
runs-on: ubuntu-latest
35+
needs: tests
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.11"
42+
43+
- name: Build wheel
44+
run: pip install build && python -m build --wheel
45+
46+
- name: Verify version importable
47+
run: |
48+
pip install dist/sgr_agent_core-*.whl
49+
python -c "import sgr_agent_core; print('Version:', sgr_agent_core.__version__)"
50+
51+
- uses: actions/upload-artifact@v4
52+
with:
53+
name: wheel
54+
path: dist/*.whl
55+
56+
# ─────────────────────────────────────────────
57+
# 3. Server startup check (no real API keys)
58+
# ─────────────────────────────────────────────
59+
server-startup:
60+
name: Server startup
61+
runs-on: ubuntu-latest
62+
needs: tests
63+
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: actions/setup-python@v5
67+
with:
68+
python-version: "3.11"
69+
70+
- name: Install dependencies
71+
run: pip install -e ".[dev,tests]"
72+
73+
- name: Write minimal CI config
74+
run: |
75+
cat > /tmp/ci_config.yaml << 'EOF'
76+
llm:
77+
api_key: "test-key"
78+
base_url: "https://api.openai.com/v1"
79+
model: "gpt-4o-mini"
80+
tools:
81+
web_search_tool:
82+
engine: "tavily"
83+
api_key: "test-tavily-key"
84+
max_results: 5
85+
max_searches: 4
86+
extract_page_content_tool:
87+
tavily_api_key: "test-tavily-key"
88+
final_answer_tool:
89+
generate_plan_tool:
90+
adapt_plan_tool:
91+
agents:
92+
ci_agent:
93+
base_class: "SGRToolCallingAgent"
94+
tools:
95+
- "web_search_tool"
96+
- "final_answer_tool"
97+
- "generate_plan_tool"
98+
- "adapt_plan_tool"
99+
EOF
100+
101+
- name: Start server and check /v1/models
102+
run: |
103+
python -m sgr_agent_core.server --config-file /tmp/ci_config.yaml --host 127.0.0.1 --port 8010 &
104+
sleep 4
105+
curl -sf http://127.0.0.1:8010/v1/models | python -m json.tool
106+
models=$(curl -s http://127.0.0.1:8010/v1/models | python -c "import sys,json; d=json.load(sys.stdin); print([m['id'] for m in d['data']])")
107+
echo "Loaded models: $models"
108+
curl -sf http://127.0.0.1:8010/docs > /dev/null && echo "Swagger UI OK"
109+
110+
# ─────────────────────────────────────────────
111+
# 4. Live agent tests (requires secrets)
112+
# ─────────────────────────────────────────────
113+
live-agents:
114+
name: Live agent tests
115+
runs-on: ubuntu-latest
116+
needs: server-startup
117+
118+
steps:
119+
- uses: actions/checkout@v4
120+
- uses: actions/setup-python@v5
121+
with:
122+
python-version: "3.11"
123+
124+
- name: Install dependencies
125+
run: pip install -e ".[dev,tests]"
126+
127+
- name: Write live config from secrets
128+
env:
129+
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
130+
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
131+
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
132+
run: |
133+
cat > /tmp/live_config.yaml << EOF
134+
llm:
135+
api_key: "${LLM_API_KEY}"
136+
base_url: "${LLM_BASE_URL:-https://api.openai.com/v1}"
137+
model: "gpt-4o-mini"
138+
max_tokens: 4000
139+
execution:
140+
max_iterations: 5
141+
max_clarifications: 1
142+
tools:
143+
web_search_tool:
144+
engine: "tavily"
145+
api_key: "${TAVILY_API_KEY}"
146+
max_results: 5
147+
max_searches: 2
148+
extract_page_content_tool:
149+
tavily_api_key: "${TAVILY_API_KEY}"
150+
content_limit: 2000
151+
final_answer_tool:
152+
generate_plan_tool:
153+
adapt_plan_tool:
154+
create_report_tool:
155+
clarification_tool:
156+
reasoning_tool:
157+
agents:
158+
sgr_agent:
159+
base_class: "examples.sgr_deep_research.agents.ResearchSGRAgent"
160+
tools:
161+
- "web_search_tool"
162+
- "final_answer_tool"
163+
- "generate_plan_tool"
164+
- "adapt_plan_tool"
165+
sgr_tool_calling_agent:
166+
base_class: "examples.sgr_deep_research.agents.ResearchSGRToolCallingAgent"
167+
tools:
168+
- "web_search_tool"
169+
- "final_answer_tool"
170+
- "reasoning_tool"
171+
- "generate_plan_tool"
172+
- "adapt_plan_tool"
173+
tool_calling_agent:
174+
base_class: "examples.sgr_deep_research.agents.ResearchToolCallingAgent"
175+
tools:
176+
- "web_search_tool"
177+
- "final_answer_tool"
178+
- "generate_plan_tool"
179+
- "adapt_plan_tool"
180+
iron_agent:
181+
base_class: "examples.sgr_deep_research.agents.ResearchIronAgent"
182+
tools:
183+
- "web_search_tool"
184+
- "final_answer_tool"
185+
- "generate_plan_tool"
186+
- "adapt_plan_tool"
187+
EOF
188+
189+
- name: Start server
190+
run: |
191+
python -m sgr_agent_core.server --config-file /tmp/live_config.yaml --host 127.0.0.1 --port 8010 &
192+
sleep 5
193+
194+
- name: Test each agent
195+
run: |
196+
QUERY='{"messages": [{"role": "user", "content": "What is 2+2? Answer briefly."}], "stream": true}'
197+
for agent in sgr_agent sgr_tool_calling_agent tool_calling_agent iron_agent; do
198+
echo "--- Testing $agent ---"
199+
result=$(curl -s -X POST http://127.0.0.1:8010/v1/chat/completions \
200+
-H "Content-Type: application/json" \
201+
-d "{\"model\": \"$agent\", $QUERY}" \
202+
--max-time 120 -N)
203+
if echo "$result" | grep -q "\[DONE\]"; then
204+
echo "✅ $agent: OK"
205+
else
206+
echo "❌ $agent: FAILED"
207+
echo "$result" | tail -5
208+
exit 1
209+
fi
210+
done

0 commit comments

Comments
 (0)