Skip to content

Commit 7c80f21

Browse files
Update test.yml
1 parent 9ebf130 commit 7c80f21

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
11
name: Test WebUI Startup
22

3-
on: [pull_request, push]
3+
on: [push, pull_request]
44

55
jobs:
66
test-webui:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- name: Checkout código
10+
- name: Checkout do código
1111
uses: actions/checkout@v3
1212

13-
- name: Instalar dependências
13+
- name: Instalar dependências de sistema
1414
run: |
1515
sudo apt-get update
16-
sudo apt-get install -y libgl1-mesa-glx wait-for-it curl
17-
python -m venv venv
16+
sudo apt-get install -y python3-venv curl
17+
18+
- name: Configurar ambiente virtual e dependências Python
19+
run: |
20+
python3 -m venv venv
1821
source venv/bin/activate
19-
pip install -r requirements.txt || true # use requirements.txt se existir
22+
pip install --upgrade pip
23+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2024
21-
- name: Iniciar servidor WebUI
25+
- name: Iniciar WebUI em background
2226
run: |
2327
source venv/bin/activate
2428
nohup python webui.py > log.txt 2>&1 &
25-
29+
2630
- name: Esperar servidor iniciar
2731
run: |
28-
chmod +x wait-for-it.sh || true
29-
wait-for-it --timeout=20 127.0.0.1:7860
32+
sleep 20
33+
curl -sf http://127.0.0.1:7860 || (echo "Servidor não respondeu" && cat log.txt && exit 1)
3034
31-
- name: Testar API (opcional)
35+
- name: Encerrar servidor (se rodando)
3236
run: |
3337
curl -X POST http://127.0.0.1:7860/sdapi/v1/server-stop || true
3438
35-
- name: Mostrar log do servidor
39+
- name: Mostrar log final do servidor
3640
run: |
3741
cat log.txt || true

0 commit comments

Comments
 (0)