-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 2.54 KB
/
ci-build.yml
File metadata and controls
81 lines (65 loc) · 2.54 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
name: CI Build
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build with Docker Compose
run: |
docker compose build
- name: Verify builds completed
run: |
echo "✅ Docker Compose build completed successfully"
docker images | grep memoryalpha-rag-api
- name: Test health endpoint readiness
run: |
# Start services in background
docker compose up -d
# Wait for services to be ready (max 5 minutes)
timeout 300 bash -c 'until curl -f http://localhost:8000/memoryalpha/health > /dev/null 2>&1; do sleep 5; echo "Waiting for API..."; done'
# Verify health endpoint
curl -f http://localhost:8000/memoryalpha/health
echo "✅ Health check passed"
- name: Test ask endpoint
run: |
# Test the synchronous ask endpoint with a simple query
response=$(curl -s -f "http://localhost:8000/memoryalpha/rag/ask?question=What%20is%20the%20Enterprise?&thinkingmode=DISABLED&max_tokens=100&top_k=3")
# Check if response contains expected content
if echo "$response" | grep -q "Enterprise"; then
echo "✅ Ask endpoint test passed"
else
echo "❌ Ask endpoint test failed - no relevant content found"
echo "Response: $response"
exit 1
fi
- name: Test streaming endpoint
run: |
# Test the streaming endpoint
response=$(timeout 30 curl -s -N -H "Accept: text/event-stream" \
"http://localhost:8000/memoryalpha/rag/stream?question=What%20is%20a%20Transporter?&thinkingmode=DISABLED&max_tokens=50&top_k=3" \
| head -10)
# Check if streaming response contains data events
if echo "$response" | grep -q "data:"; then
echo "✅ Streaming endpoint test passed"
else
echo "❌ Streaming endpoint test failed - no streaming data found"
echo "Response: $response"
exit 1
fi
- name: Generate OpenAPI spec
run: |
# Download OpenAPI spec
curl -s http://localhost:8000/openapi.json -o memoryalpha-rag-api-spec.json
cat memoryalpha-rag-api-spec.json
- name: Cleanup
if: always()
run: |
docker compose down -v
docker system prune -f