name: testbed

on: [push]

jobs:

  linux:
    timeout-minutes: 15
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: Install required packages
      run: |
        sudo apt update
        sudo apt install -y \
            build-essential \
            git \
            make \
            pkg-config \
            cmake \
            ninja-build \
            gnome-desktop-testing \
            libasound2-dev \
            libpulse-dev \
            libaudio-dev \
            libjack-dev \
            libsndio-dev \
            libx11-dev \
            libxext-dev \
            libxrandr-dev \
            libxcursor-dev \
            libxfixes-dev \
            libxi-dev \
            libxss-dev \
            libxtst-dev \
            libxkbcommon-dev \
            libdrm-dev \
            libgbm-dev \
            libgl1-mesa-dev \
            libgles2-mesa-dev \
            libegl1-mesa-dev \
            libdbus-1-dev \
            libibus-1.0-dev \
            libudev-dev \
            libpipewire-0.3-dev \
            libwayland-dev \
            libdecor-0-dev \
            liburing-dev
    - name: Compile testbed
      working-directory: build
      run: |
        cmake -DENTT_BUILD_TESTBED=ON ..
        make -j4

  windows:
    timeout-minutes: 15
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v4
    - uses: seanmiddleditch/gha-setup-ninja@master
    - name: Compile testbed
      working-directory: build
      run: |
        cmake -DENTT_BUILD_TESTBED=ON .. -G Ninja
        cmake --build . -j 4

  macos:
    timeout-minutes: 15
    runs-on: macOS-latest

    steps:
    - uses: actions/checkout@v4
    - name: Compile testbed
      working-directory: build
      run: |
        cmake -DENTT_BUILD_TESTBED=ON ..
        make -j4
