name: Debian Build

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  debian_build:
    runs-on: ubuntu-24.04
    container:
      image: debian:bookworm

    steps:
      - name: Install base tooling (git + deps)
        run: |
          set -eux
          export DEBIAN_FRONTEND=noninteractive
          apt-get update
          apt-get install -y --no-install-recommends \
                git ca-certificates \
                build-essential pkg-config meson ninja-build cmake \
                gettext \
                libcanberra-dev libdbus-glib-1-dev libglib2.0-dev libgtk2.0-dev \
                libluajit-5.1-dev libpci-dev libperl-dev libssl-dev \
                python3-dev python3-cffi mono-devel desktop-file-utils
      - uses: actions/checkout@v4
        with:
          submodules: true

      - name: Configure
        run: |
          set -eux
          rm -rf build
          meson setup build \
            -Dtext-frontend=true \
            -Dtheme-manager=true \
            -Dauto_features=enabled
        # If configure fails, show the project's actual option names in the log.
      - name: Show Meson options (on failure)
        if: failure()
        run: |
          set -eux
          meson configure build || true

      - name: Build
        run: |
          set -eux
          ninja -C build

      - name: Test
        run: |
          set -eux
          ninja -C build test

      - name: Install
        run: |
          set -eux
          ninja -C build install
