Refactor webui() to improve code structure and modularity #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |