-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (143 loc) · 4.91 KB
/
integration.yml
File metadata and controls
168 lines (143 loc) · 4.91 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
name: Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
agent_url:
description: 'AxonFlow Agent URL (defaults to staging)'
required: false
default: 'https://staging-eu.getaxonflow.com'
permissions:
contents: read
env:
DO_NOT_TRACK: '1'
# Note: github.event.inputs only available on workflow_dispatch, defaults used otherwise
AXONFLOW_AGENT_URL: ${{ github.event.inputs.agent_url || 'https://staging-eu.getaxonflow.com' }}
AXONFLOW_CLIENT_ID: ${{ secrets.AXONFLOW_CLIENT_ID || 'demo-client' }}
AXONFLOW_CLIENT_SECRET: ${{ secrets.AXONFLOW_CLIENT_SECRET || 'demo-secret' }}
jobs:
contract-tests:
name: Contract Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run contract tests
run: pytest tests/test_contract.py -v --no-cov
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
# Only run on main branch or manual dispatch with secrets configured
if: github.event_name == 'workflow_dispatch' || (github.ref == 'refs/heads/main' && github.event_name == 'push')
needs: contract-tests
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -e ".[dev,all]"
- name: Run integration tests
env:
RUN_INTEGRATION_TESTS: '1'
AXONFLOW_LICENSE_KEY: ${{ secrets.AXONFLOW_LICENSE_KEY }}
run: pytest tests/test_integration.py -v --no-cov
continue-on-error: true # Don't fail build if staging is down
demo-scripts:
name: Demo Scripts Validation
runs-on: ubuntu-latest
needs: contract-tests
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -e ".[dev,all]"
- name: Validate quickstart.py syntax
run: python -m py_compile examples/quickstart.py
- name: Validate gateway_mode.py syntax
run: python -m py_compile examples/gateway_mode.py
- name: Validate openai_integration.py syntax
run: python -m py_compile examples/openai_integration.py
- name: Run quickstart (dry-run mode)
run: |
python -c "
import asyncio
from examples.quickstart import main
# Verify module imports correctly
print('quickstart.py imports successfully')
"
- name: Run gateway_mode (dry-run mode)
run: |
python -c "
import asyncio
from examples.gateway_mode import main, blocked_example
# Verify module imports correctly
print('gateway_mode.py imports successfully')
"
community-stack-tests:
name: Community Stack E2E
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
needs: [contract-tests, demo-scripts]
services:
agent:
image: ghcr.io/getaxonflow/axonflow-agent:latest
ports:
- 8080:8080
env:
AXONFLOW_MODE: community
AXONFLOW_DEBUG: 'true'
options: >-
--health-cmd "wget --spider -q http://localhost:8080/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -e ".[dev,all]"
- name: Wait for agent to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:8080/health | grep -q healthy; then
echo "Agent is ready!"
exit 0
fi
echo "Waiting for agent... ($i/30)"
sleep 2
done
echo "Agent failed to start"
exit 1
- name: Run SDK against community stack
env:
AXONFLOW_AGENT_URL: 'http://localhost:8080'
AXONFLOW_CLIENT_ID: 'test-client'
AXONFLOW_CLIENT_SECRET: 'test-secret'
RUN_INTEGRATION_TESTS: '1'
run: |
# Run integration tests against local community stack
pytest tests/test_integration.py -v --no-cov
- name: Run demo scripts against community stack
env:
AXONFLOW_AGENT_URL: 'http://localhost:8080'
AXONFLOW_CLIENT_ID: 'test-client'
AXONFLOW_CLIENT_SECRET: 'test-secret'
run: |
# Run quickstart demo
python examples/quickstart.py || echo "Quickstart completed (may fail without LLM)"