Spaces:
Running
Running
| name: CI | |
| on: { push: { branches: [main] }, pull_request: {}, workflow_dispatch: {} } | |
| # Supersede an in-flight run when a newer commit lands, instead of leaving a | |
| # queued job to be cancelled later -- a cancelled run shows red on the badge | |
| # and is indistinguishable from a real failure at a glance. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - run: pip install pytest ruff==0.14.9 -r requirements.txt | |
| - name: Demo logic and app wiring | |
| run: pytest -q | |
| - name: Lint | |
| run: ruff check . | |
| # The Space is only useful if it actually serves. Build the Blocks app and | |
| # confirm every tab is present, rather than trusting that it imports. | |
| - name: The app builds and serves all three tabs | |
| run: | | |
| python - <<'PY' | |
| import app | |
| demo = app.build() | |
| labels = {b.label for b in demo.blocks.values() | |
| if type(b).__name__ == "TabItem"} | |
| expected = {"S-parameters", "Coupling extractors", "The certified bound"} | |
| assert expected <= labels, f"missing tabs: {expected - labels}" | |
| assert len(demo.fns) >= 8, "event handlers went missing" | |
| print(f"OK: {len(demo.blocks)} components, {len(demo.fns)} handlers") | |
| PY | |