name: Publish AOTCompatibility testApp

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

jobs:
  aot-test:
    strategy:
      fail-fast: false  # ensures the entire test matrix is run, even if one permutation fails
      matrix:
        os: [ ubuntu-latest ]
        version: [ net7.0 ]

    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0 # fetching all

    - name: Setup dotnet
      uses: actions/setup-dotnet@v3

    - name: publish AOT testApp, assert static analysis warning count, and run the app
      shell: pwsh
      run: .\build\test-aot-compatibility.ps1 ${{ matrix.version }}
