mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-05 21:12:11 -04:00
The first windows-desktop run hung for 25 minutes with no output and ran until it was cancelled. Pass --blame-hang-timeout 5m so a test that is silent for five minutes is killed, named in the log and mini-dumped into TestResults, then cap the job at 20 minutes and upload all of TestResults, not just the TRX files. Checked locally with a throwaway xunit project: a Thread.Sleep(Infinite) test was killed after the configured inactivity, named in the output, and left a TRX, a test-order (Sequence) file and a mini dump; dotnet test exited 1.
73 lines
2.6 KiB
YAML
73 lines
2.6 KiB
YAML
name: Cross-platform tests
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [master]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
- name: Run OpenNest.Tests
|
|
run: dotnet test OpenNest.Tests/OpenNest.Tests.csproj
|
|
- name: Run OpenNest.Engine.Tests
|
|
run: dotnet test OpenNest.Engine.Tests/OpenNest.Engine.Tests.csproj
|
|
- name: Check six synthetic Irregular nests
|
|
timeout-minutes: 6
|
|
run: |
|
|
python3 scripts/test_check_synthetic_nests.py -v
|
|
python3 scripts/check-synthetic-nests.py --parallel 2
|
|
- name: Run OpenNest.IO.Tests
|
|
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: 20
|
|
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
|
|
# A test silent for 5 minutes is killed and named in the log, with a
|
|
# mini dump in TestResults, instead of holding the runner until the
|
|
# job timeout.
|
|
run: |
|
|
$failed = @()
|
|
foreach ($project in @('OpenNest.WinForms.Tests', 'OpenNest.FrontEnd.Tests')) {
|
|
dotnet test "$project/$project.csproj" -c Release --blame-hang-timeout 5m --blame-hang-dump-type mini --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/
|
|
if-no-files-found: warn
|
|
retention-days: 14
|