mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-06 14:12:10 -04:00
ci: run WinForms and front-end tests on a Windows runner
Pushes to master only ran the Linux job, which can cross-compile but not execute OpenNest.WinForms.Tests; Windows test runs happened only on release branches and tags. Add a windows-2022 job to the cross-platform workflow that runs OpenNest.WinForms.Tests and OpenNest.FrontEnd.Tests in Release on every master push and pull request, runs both projects before failing, and uploads their TRX results.
This commit is contained in:
1 parent
90587803be
commit
2a5ebf1e8a
2 files changed
+36
-1
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user