sway / .github /workflows /ci.yml
Claude
Claude Opus 5
Document autoplay, run the whole fast suite in CI, bump to 1.1.0
ee9a958 unverified
Raw History Blame Contribute Delete
1.28 kB
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install (CPU torch keeps the runner small)
run: |
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements-dev.txt
- name: Fast tests
run: pytest -q
- name: App imports without loading models
env:
SWAY_SKIP_ENGINE: "1"
run: python -c "import app; print('ok')"
deploy:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
lfs: true
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_SPACE: ${{ vars.HF_SPACE }}
run: |
if [ -z "$HF_TOKEN" ] || [ -z "$HF_SPACE" ]; then
echo "HF_TOKEN secret or HF_SPACE variable not set, skipping deploy"; exit 0
fi
git push --force "https://user:${HF_TOKEN}@huggingface.co/spaces/${HF_SPACE}" HEAD:main