name: Build and Test

on:
  pull_request:
    branches:
      - main

jobs:
  call-reusable-build-test:
    uses: ./.github/workflows/dotnet-build-test.yml

  build-test:
    needs: call-reusable-build-test
    runs-on: windows-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: |
            3.1.x
            6.0.x
            8.0.x

      - name: Restore dependencies
        run: dotnet restore

      - name: Build
        run: dotnet build --configuration Release --no-restore

      - name: Test
        run: dotnet test --no-restore --verbosity normal
