diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5066d29..ab5bac1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,3 +32,38 @@ jobs: run: dotnet test OpenNest.IO.Tests/OpenNest.IO.Tests.csproj - name: Run OpenNest.Server.Tests run: dotnet test OpenNest.Server.Tests/OpenNest.Server.Tests.csproj + + windows-desktop: + # WinForms tests need a Windows desktop runtime; the Linux job can only + # cross-compile them. FrontEnd.Tests run here too, alongside the desktop. + runs-on: windows-2022 + timeout-minutes: 30 + defaults: + run: + shell: pwsh + env: + DOTNET_CLI_TELEMETRY_OPTOUT: '1' + DOTNET_NOLOGO: '1' + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 + with: + dotnet-version: '8.0.x' + - name: Run Windows desktop and front-end tests + run: | + $failed = @() + foreach ($project in @('OpenNest.WinForms.Tests', 'OpenNest.FrontEnd.Tests')) { + dotnet test "$project/$project.csproj" -c Release --logger "trx;LogFileName=$project.trx" --results-directory TestResults + if ($LASTEXITCODE -ne 0) { $failed += $project } + } + if ($failed.Count -gt 0) { throw "Failed: $($failed -join ', ')" } + - name: Upload test results + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: windows-desktop-test-results + path: TestResults/*.trx + if-no-files-found: warn + retention-days: 14 diff --git a/README.md b/README.md index 56f2219..19c04d8 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ dotnet test OpenNest.FrontEnd.Tests/OpenNest.FrontEnd.Tests.csproj # console/MCP dotnet run --project OpenNest/OpenNest.csproj # desktop app (Windows) ``` -`OpenNest.WinForms.Tests` (desktop-assembly tests) runs on Windows only. Format changed files with `dotnet format OpenNest.sln --include `. +`OpenNest.WinForms.Tests` (desktop-assembly tests) runs on Windows only; CI runs it and `OpenNest.FrontEnd.Tests` on a GitHub-hosted Windows runner for every master push and pull request. Format changed files with `dotnet format OpenNest.sln --include `. Shared coding-agent guidance lives in [AGENTS.md](AGENTS.md). [CLAUDE.md](CLAUDE.md) imports it for Claude Code compatibility; make shared instruction changes in AGENTS.md, not in duplicate agent-specific copies.