name: API Compatibility

on:
  pull_request:
    branches: [ 'main*' ]
    paths-ignore:
    - '**.md'

jobs:
  build-test:
    runs-on: windows-latest
    env:
      CheckAPICompatibility: true

    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0 # fetching all

    - name: Setup .NET 7.0
      uses: actions/setup-dotnet@v3.2.0
      with:
        dotnet-version: '7.0.x'

    - name: Install dependencies
      run: dotnet restore

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