alanclayrichard's picture
initial commit with test setup
b78ff28
Raw History Blame Contribute Delete
1.41 kB
# Lint, type-check and test the scoring library and the Space's modules.
#
# Hugging Face Spaces do not run GitHub Actions, and this repository *is* the
# Space — so this workflow only does anything if you also mirror the repo to
# GitHub. It is committed because the checks are worth having available, and it
# is inert otherwise.
name: checks
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e ".[space,dev]"
- name: Lint
run: ruff check .
- name: Type-check
run: mypy plug_challenge/ app.py config.py submission.py leaderboards.py models.py utils.py
- name: Test
# No HF_TOKEN: the suite is synthetic and must never need the Hub. If a
# test starts failing here but passing locally, it has grown a dependency
# on real data or real credentials — fix the test, don't add a secret.
run: pytest tests/ -q
- name: Check the Space's app graph builds in every phase
run: |
for phase in 0 1 2; do
CURRENT_PHASE=$phase python -c "import app; print(f'phase {app.CURRENT_PHASE} OK')"
done