-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1.28 KB
/
Copy pathbasic-test.yml
File metadata and controls
44 lines (36 loc) · 1.28 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
name: Basic Functionality Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.14'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start server in background
run: |
python main.py --model "sd-legacy/stable-diffusion-v1-5" --device cpu --steps-scale 1 | tee server.log &
timeout 600 bash -c 'until curl -f http://localhost:8000/health; do sleep 2; done'
- name: Test image generation
run: |
tail -f server.log &
curl -f -X POST http://localhost:8000/v1/images/generations \
-H "Content-Type: application/json" \
-d '{
"prompt": "a simple test image",
"model": "sd-legacy/stable-diffusion-v1-5"
}' | jq '.data[0].b64_json' | wc -c | awk '{if($1 > 100) print "SUCCESS: Image generated"; else {print "FAILED: Image too small"; exit 1}}'
- name: Test metrics endpoint
run: |
curl -f http://localhost:8000/metrics