name: Build

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build_linux:
    name: Linux Build
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: 'recursive'

      - name: Setup environment
        run: |
          sudo apt-get update -qq
          sudo apt-get install gcc-multilib
          sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libwayland-bin libxkbcommon-dev ninja-build

      - name: Configure cmake
        run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DPLATFORM=Desktop

      - name: Build
        run: cmake --build build

  build_windows:
    name: Windows Build
    runs-on: windows-latest

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: 'recursive'

      - name: Configure cmake
        run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DPLATFORM=Desktop

      - name: Build
        run: cmake --build build
