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: 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