name: Build Project (Debug)

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
    
jobs:
  build:
    strategy:
      matrix:
        runs-on: [ubuntu-latest, windows-latest, macos-latest]
    runs-on: ${{ matrix.runs-on }}

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: 'true'
          ref: ${{ github.ref }}
      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.0.x'
      - name: Solution Compilation (Windows)
        if: matrix.runs-on == 'windows-latest'
        run: cd tools ; ./build.cmd Debug ; cd ..
      - name: Solution Compilation (Unix)
        if: matrix.runs-on != 'windows-latest'
        run: make dbg
      - name: Testing
        run: dotnet test --no-build --configuration Debug