Create test.yml

This commit is contained in:
Lucas Santos 2025-06-25 21:37:27 -03:00 committed by GitHub
parent 0e75f96b34
commit 9ebf130694
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

37
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Test WebUI Startup
on: [pull_request, push]
jobs:
test-webui:
runs-on: ubuntu-latest
steps:
- name: Checkout código
uses: actions/checkout@v3
- name: Instalar dependências
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-glx wait-for-it curl
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt || true # use requirements.txt se existir
- name: Iniciar servidor WebUI
run: |
source venv/bin/activate
nohup python webui.py > log.txt 2>&1 &
- name: Esperar servidor iniciar
run: |
chmod +x wait-for-it.sh || true
wait-for-it --timeout=20 127.0.0.1:7860
- name: Testar API (opcional)
run: |
curl -X POST http://127.0.0.1:7860/sdapi/v1/server-stop || true
- name: Mostrar log do servidor
run: |
cat log.txt || true