b7e50455ad
PyGObject >= 3.52 dropped the standalone gobject-introspection girepository-1.0 dependency and now builds against girepository-2.0, which was merged into GLib 2.80. The linux extra pins PyGObject>=3.46 with no upper bound, so pip resolves the newest release (3.56.3) and meson aborts metadata generation with: Dependency 'girepository-2.0' is required but not found. because CI only installed the old libgirepository1.0-dev. Swap libgirepository1.0-dev -> libgirepository-2.0-dev (shipped by GLib 2.80 on the ubuntu-latest / 24.04 runner) across all three Linux pip-install paths so they stay in sync: - test.yml: the failing linux-smoke job. - release.yml: build-linux, which would otherwise ship a broken Linux tarball on the next tag. - build.yml: build-linux had no system-deps step at all; added the matching apt install so the manual artifact build works too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
101 lines
3.2 KiB
YAML
101 lines
3.2 KiB
YAML
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
|
|
'
|