Spaces:
Running
on
Zero
Running
on
Zero
| name: Manual workflow | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: self-hosted | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Create virtual environment | |
| run: | | |
| python -m venv .venv | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| . .venv/Scripts/activate | |
| else | |
| . .venv/bin/activate | |
| fi | |
| shell: bash | |
| - name: Install dependencies | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| . .venv/Scripts/activate | |
| else | |
| . .venv/bin/activate | |
| fi | |
| python -m pip install --upgrade pip | |
| pip install uv | |
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124 | |
| pip install "numpy<2.0.0" | |
| if [ -f requirements.txt ]; then | |
| uv pip install -r requirements.txt | |
| fi | |
| shell: bash | |
| - name: Test pipeline variants | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ]; then | |
| . .venv/Scripts/activate | |
| else | |
| . .venv/bin/activate | |
| fi | |
| # Test basic pipeline | |
| python modules/user/pipeline.py "1girl" 512 512 1 1 --hires-fix --adetailer --autohdr --prio-speed | |
| # Test image to image | |
| python modules/user/pipeline.py "./_internal/output/Adetailer/LD-head_00001_.png" 512 512 1 1 --img2img --prio-speed | |
| shell: bash | |
| - name: Upload test artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-outputs-${{ github.sha }} | |
| path: | | |
| _internal/output/**/*.png | |
| _internal/output/Classic/*.png | |
| _internal/output/Flux/*.png | |
| _internal/output/HF/*.png | |
| retention-days: 5 | |
| compression-level: 6 | |
| if-no-files-found: warn | |
| - name: Report status | |
| if: always() | |
| run: | | |
| if [ ${{ job.status }} == 'success' ]; then | |
| echo "All tests passed successfully!" | |
| else | |
| echo "Some tests failed. Check the logs above for details." | |
| exit 1 | |
| fi | |
| shell: bash | |