name: CI-Windows-WindowsServiceStatus

on:
  push:
    branches: [ main, feat/windows-service-status-auto ]
  pull_request:
    branches: [ main, feat/windows-service-status-auto ]

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

      - name: Restore NuGet packages
        run: dotnet restore

      - name: Build backend
        run: dotnet build -c Release --no-restore

      - name: Run Windows service related tests
        run: dotnet test tests/CncService.Tests/CncService.Tests.csproj -c Release --no-build -v minimal --filter "FullyQualifiedName~WindowsServiceCheckerTests|FullyQualifiedName~DashboardServiceTests"

      - name: Build frontend
        run: |
          cd frontend
          npm ci
          npm run build

      - name: Test summary
        if: always()
        run: |
          echo "=== CI Summary ==="
          echo "Backend: Build + WindowsService/Dashboard tests"
          echo "Frontend: Build (vue-tsc + vite)"
          echo "=================="
