Spaces:
Running
Running
| name: tests | |
| # Runs the pytest suite on every push / PR to main. | |
| # Mirrors the local workflow: `pytest -q` from the repo root. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: {} | |
| jobs: | |
| pytest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Match the HF Space runtime (Dockerfile: FROM python:3.12-slim). | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: .github/workflows/test.yml | |
| - name: Install test dependencies | |
| # The suite mocks / lazily-loads the ESM-2 scorer, so it does NOT need | |
| # torch / transformers / accelerate (the ~GB ML stack). Those runtime | |
| # deps are validated by the HF Space Docker build instead; installing | |
| # them here would only slow CI for tests that never import them. | |
| # If a future test exercises the real scorer, add CPU torch here: | |
| # pip install torch transformers --extra-index-url https://download.pytorch.org/whl/cpu | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install biopython pandas numpy flask openpyxl "PyJWT[crypto]" pytest requests | |
| - name: Run pytest | |
| run: pytest -q | |