Spaces:
Running
Running
Claude commited on
Gate the HF Space deploy on tests passing (item 5 from review)
Browse filesdeploy-to-hf.yml previously went straight from checkout to `git push
--force` on every push to main - no lint, no type-check, no test run in
between. Added a `test` job (install deps, install Playwright's Chromium,
run pytest) and made `deploy` depend on it via `needs: test`, so a commit
that breaks the test suite no longer reaches the production HF Space.
.github/workflows/deploy-to-hf.yml
CHANGED
|
@@ -7,7 +7,28 @@ on:
|
|
| 7 |
workflow_dispatch:
|
| 8 |
|
| 9 |
jobs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
deploy:
|
|
|
|
| 11 |
runs-on: ubuntu-latest
|
| 12 |
steps:
|
| 13 |
- name: Checkout
|
|
|
|
| 7 |
workflow_dispatch:
|
| 8 |
|
| 9 |
jobs:
|
| 10 |
+
test:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
steps:
|
| 13 |
+
- name: Checkout
|
| 14 |
+
uses: actions/checkout@v4
|
| 15 |
+
|
| 16 |
+
- name: Set up Python
|
| 17 |
+
uses: actions/setup-python@v5
|
| 18 |
+
with:
|
| 19 |
+
python-version: "3.11"
|
| 20 |
+
|
| 21 |
+
- name: Install dependencies
|
| 22 |
+
run: pip install -r requirements-dev.txt
|
| 23 |
+
|
| 24 |
+
- name: Install Playwright's Chromium
|
| 25 |
+
run: playwright install --with-deps chromium
|
| 26 |
+
|
| 27 |
+
- name: Run tests
|
| 28 |
+
run: pytest
|
| 29 |
+
|
| 30 |
deploy:
|
| 31 |
+
needs: test
|
| 32 |
runs-on: ubuntu-latest
|
| 33 |
steps:
|
| 34 |
- name: Checkout
|