name: Desktop tests

# Автозапуск юнит-тестов десктопа при изменениях кода.
# Работает и в GitHub Actions, и в Gitea Actions (если настроены раннеры).
on:
  push:
    paths:
      - 'src/Elfisa.Core/**'
      - 'src/Elfisa.Avalonia/**'
      - 'tests/**'
      - '.github/workflows/desktop-tests.yml'
  pull_request:
  workflow_dispatch:

jobs:
  test:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup .NET 8
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.0.x'

      - name: Restore
        run: dotnet restore tests/Elfisa.Tests/Elfisa.Tests.csproj

      - name: Test
        run: dotnet test tests/Elfisa.Tests/Elfisa.Tests.csproj -c Release --no-restore --logger "console;verbosity=minimal"
