phytoevidence-api / test_hf_deploy_workflow.py
github-actions[bot]
Deploy GitHub 3bce42ac1338
60bae3f
Raw History Blame Contribute Delete
748 Bytes
from pathlib import Path
WORKFLOW = Path(__file__).parent / ".github/workflows/deploy-huggingface-space.yml"
def test_hf_deploy_is_manual_and_uses_scoped_secret():
content = WORKFLOW.read_text(encoding="utf-8")
assert "workflow_dispatch:" in content
assert "github.event.inputs.confirm == 'DEPLOY'" in content
assert "secrets.HF_WRITE_TOKEN" in content
assert "\n push:" not in content
def test_hf_deploy_verifies_exact_revision_and_health():
content = WORKFLOW.read_text(encoding="utf-8")
assert "data.get(\"sha\") == os.environ[\"EXPECTED_SHA\"]" in content
assert 'runtime.get("stage") == "RUNNING"' in content
assert 'health.get("status") != "ok"' in content
assert "rsync -a --delete" in content