name: "DirectX"

# Test that DirectX 11 and 12 build work on Windows
on:
  workflow_dispatch:
  pull_request:
  push:

jobs:
  build:
    name: DirectX
    runs-on: windows-latest
    strategy:
      fail-fast: false
      matrix:
        directx_version: [11, 12]

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: true

      - name: Build
        shell: bash
        run: |
          mkdir build
          cd build
          if [ "${{ matrix.directx_version }}" = "11" ]; then 
            cmake .. -DHELLOIMGUI_USE_SDL2=ON  -DHELLOIMGUI_HAS_DIRECTX11=ON -DCMAKE_BUILD_TYPE=Release; 
          fi
          if [ "${{ matrix.directx_version }}" = "12" ]; then 
            cmake .. -DHELLOIMGUI_USE_SDL2=ON -DHELLOIMGUI_HAS_DIRECTX12=ON -DCMAKE_BUILD_TYPE=Release; 
          fi
          cmake --build . -j 3
