name: Windows x64 Build

on:
  push:
    branches:
      - boogaloo
  pull_request:
    branches:
      - boogaloo

jobs:
  build:
    runs-on: windows-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Set up Qt
        uses: jurplel/install-qt-action@v3
        with:
          version: '6.7.3'
          host: 'windows'
          target: 'desktop'
          arch: 'win64_msvc2019_64'

      - name: Install CMake
        run: |
          choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' --yes

      - name: Install Visual Studio Build Tools
        run: |
          choco install visualstudio2019buildtools --version=16.11.9 --yes
          choco install visualstudio2019-workload-vctools --yes

      - name: Configure CMake
        shell: cmd
        run: |
          call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
          cmake -S src -B build -G "NMake Makefiles" -DCMAKE_PREFIX_PATH:PATH="%Qt5_DIR%"

      - name: Build the project
        shell: cmd
        run: |
          call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
          cmake --build build --config Release
