Spaces:
No application file
No application file
Download .github/workflows/test.yml from Adi-19/SupportEnv: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/spaces/Adi-19/SupportEnv/resolve/main/.github/workflows/test.yml
- Command line
-
hf download hf://spaces/Adi-19/SupportEnv/.github/workflows/test.yml
-
curl -L -o test.yml https://huggingface.co/spaces/Adi-19/SupportEnv/resolve/main/.github/workflows/test.yml
1.65 kB
| name: SupportEnv CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run pytest | |
| run: | | |
| pytest tests/ -v --tb=short | |
| - name: Run openenv validate | |
| run: | | |
| python -m openenv.core.cli validate openenv.yaml || echo "Validation completed" | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-${{ matrix.python-version }} | |
| path: | | |
| .pytest_cache/ | |
| *.xml | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t support-env:latest -f server/Dockerfile . | |
| - name: Test Docker image | |
| run: | | |
| docker run -d --name support-env-test -p 7860:7860 support-env:latest | |
| sleep 10 | |
| curl -f http://localhost:7860/health || exit 1 | |
| docker stop support-env-test | |