name: Lint & Test on: push: branches: [master] pull_request: branches: [master] jobs: test: if: "!startsWith(github.event.head_commit.message, 'chore: release')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - name: Build frontend run: npm ci && npm run build - uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | pip install --upgrade pip pip install -e ".[dev]" - name: Lint run: ruff check media_server/ - name: Test run: pytest --tb=short -q || test $? -eq 5 # Linux smoke test: install the linux extra in the same way build-dist-linux.sh # does, then boot the server and hit /api/health. Catches dependency-resolution # and import-time regressions for the Linux distribution path. linux-smoke: if: "!startsWith(github.event.head_commit.message, 'chore: release')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - name: Build frontend run: npm ci && npm run build - uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install Linux system deps for dbus-python + PyGObject run: | # PyGObject >= 3.52 builds against girepository-2.0 (merged into # GLib 2.80), not the old standalone girepository-1.0. ubuntu-latest # (24.04) ships it as libgirepository-2.0-dev. sudo apt-get update sudo apt-get install -y --no-install-recommends \ libdbus-1-dev libglib2.0-dev pkg-config \ libcairo2-dev libgirepository-2.0-dev - name: Install with linux extra run: | pip install --upgrade pip pip install ".[linux]" - name: Smoke — server boots and /api/health responds run: | # Headless Linux runners have no PulseAudio and no display # server, so we disable the visualizer + update checker, and we # use `dbus-run-session` to give LinuxMediaController a real # session bus to talk to (otherwise dbus.SessionBus() would # raise during startup). This isn't a full MPRIS integration # test — it only proves the dispatcher selects the Linux # controller, all imports resolve, and /api/health returns 200. sudo apt-get install -y --no-install-recommends dbus-x11 export MEDIA_SERVER_VISUALIZER_ENABLED=false export MEDIA_SERVER_UPDATE_CHECK_ENABLED=false dbus-run-session -- bash -c ' python -m media_server.main --no-tray --port 18765 & SERVER_PID=$! for i in $(seq 1 30); do if curl -sf "http://127.0.0.1:18765/api/health" >/dev/null; then echo "Health check passed" kill $SERVER_PID wait $SERVER_PID 2>/dev/null || true exit 0 fi sleep 0.5 done echo "Server did not respond within 15s" kill $SERVER_PID 2>/dev/null || true exit 1 '