name: Windows
on: [push, pull_request]
env:
  BUILD_TYPE: Release
jobs:
  Build:
    runs-on: windows-latest
    strategy:
      matrix:
        fips: [ON, OFF]
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          submodules: true
      - name: Install Dependencies
        shell: bash
        run: choco install cmake ninja nasm -y
      - name: Create Build Environment
        run: cmake -E make_directory ${{github.workspace}}/build
      - name: Configure CMake
        working-directory: ${{github.workspace}}/build
        shell: bash
        run: |
          cmake \
          -DBUILD_TESTS=true \
          -DFIPS=${{matrix.fips}} \
          -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
          -DCMAKE_GENERATOR_PLATFORM=x64 \
          ..
      - name: Build
        shell: bash
        working-directory: ${{github.workspace}}/build
        run: cmake --build . --config ${{env.BUILD_TYPE}}
      - name: Test
        shell: bash
        working-directory: ${{github.workspace}}/build
        run: ctest --output-on-failure
      - name: Install
        shell: bash
        working-directory: ${{github.workspace}}/build
        run: cmake --install .
