Add ADS-B API ingestion and map rendering fallbacks #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-smoke-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Compile Python sources | |
| run: | | |
| python -m compileall main.py tak_bridge.py | |
| - name: FastAPI smoke test | |
| run: | | |
| python - <<'PY' | |
| from fastapi.testclient import TestClient | |
| from main import app | |
| client = TestClient(app) | |
| r = client.get("/") | |
| assert r.status_code == 200, f"/ failed: {r.status_code}" | |
| r = client.get("/api/tracks") | |
| assert r.status_code == 200, f"/api/tracks failed: {r.status_code}" | |
| payload = r.json() | |
| assert "tracks" in payload and "server_time" in payload, "tracks payload missing expected keys" | |
| r = client.get("/api/fpv/drones") | |
| assert r.status_code == 200, f"/api/fpv/drones failed: {r.status_code}" | |
| fpv_payload = r.json() | |
| assert "enabled" in fpv_payload and "drones" in fpv_payload, "fpv payload missing expected keys" | |
| r = client.get("/video/pip") | |
| assert r.status_code == 200, f"/video/pip failed: {r.status_code}" | |
| print("Smoke tests passed") | |
| PY |