name: Samples C# .Net Standard

on:
  push:
    paths:
      - 'samples/client/petstore/csharp/**netstandard**/'
  pull_request:
    paths:
      - 'samples/client/petstore/csharp/**netstandard**/'
jobs:
  build:
    name: Build .Net projects
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        sample:
          # clients
          - samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-dotnet@v3.2.0
        with:
          dotnet-version: 3.1.*
      - name: Build
        working-directory: ${{ matrix.sample }}
        run: dotnet build Org.OpenAPITools.sln
      - name: Test
        working-directory: ${{ matrix.sample }}
        run: dotnet test Org.OpenAPITools.sln
