name: Build & Test & Lint

on:
  workflow_call:
  workflow_dispatch:
  pull_request:
    branches: ['main']
  push:
    branches: ['main']

permissions: read-all

jobs:
  build-test-lint:
    name: Build & Test & Lint
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '9.0'
      - name: Restore
        run: dotnet restore
      - name: Build
        run: dotnet build --no-restore --configuration Release
      - name: Test
        run: dotnet test --no-restore --verbosity normal --logger trx --configuration Release