mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-25 15:47:40 -05:00
Runners bill each job rounded up to the minute, and every job restored and built the shared projects again. The small suites and the synthetic nests now share one job that builds once; Engine.Tests, the longest, runs beside it. A newer push cancels a stale run, and pushes that change only docs or Markdown skip CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
132 lines
5.1 KiB
YAML
132 lines
5.1 KiB
YAML
name: Cross-platform tests
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore: ['docs/**', '**/*.md']
|
|
push:
|
|
branches: [master]
|
|
paths-ignore: ['docs/**', '**/*.md']
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# A newer push to the same branch or pull request supersedes a run in progress;
|
|
# dev-build publishes only master's newest commit anyway.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
# Runners are billed per job, rounded up to the minute, and each job restores
|
|
# and builds the shared projects again. So the small suites share one job and
|
|
# build once; Engine.Tests, the longest, runs beside them in its own.
|
|
jobs:
|
|
suites:
|
|
name: Unit tests and synthetic nests
|
|
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: Test fail-closed final CI check
|
|
run: python3 scripts/test_ci_results.py -v
|
|
# Each suite runs even when an earlier one fails, so one run reports them all.
|
|
- name: Run OpenNest.Tests
|
|
if: ${{ !cancelled() }}
|
|
run: dotnet test OpenNest.Tests/OpenNest.Tests.csproj -c Release
|
|
- name: Run OpenNest.Desktop.Tests
|
|
if: ${{ !cancelled() }}
|
|
run: dotnet test OpenNest.Desktop.Tests/OpenNest.Desktop.Tests.csproj -c Release
|
|
- name: Run OpenNest.IO.Tests
|
|
if: ${{ !cancelled() }}
|
|
run: dotnet test OpenNest.IO.Tests/OpenNest.IO.Tests.csproj -c Release
|
|
- name: Run OpenNest.Server.Tests
|
|
if: ${{ !cancelled() }}
|
|
run: dotnet test OpenNest.Server.Tests/OpenNest.Server.Tests.csproj -c Release
|
|
- name: Run OpenNest.FrontEnd.Tests
|
|
if: ${{ !cancelled() }}
|
|
run: dotnet test OpenNest.FrontEnd.Tests/OpenNest.FrontEnd.Tests.csproj -c Release
|
|
- name: Check six synthetic Irregular nests
|
|
if: ${{ !cancelled() }}
|
|
timeout-minutes: 6
|
|
run: |
|
|
python3 scripts/test_check_synthetic_nests.py -v
|
|
python3 scripts/check-synthetic-nests.py --parallel 2
|
|
|
|
engine-tests:
|
|
name: Unit tests (OpenNest.Engine.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.Engine.Tests
|
|
run: dotnet test OpenNest.Engine.Tests/OpenNest.Engine.Tests.csproj -c Release
|
|
|
|
# Preserve the existing check name for required-status consumers.
|
|
tests:
|
|
name: tests
|
|
needs: [suites, engine-tests]
|
|
if: ${{ always() }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
with:
|
|
persist-credentials: false
|
|
- name: Require every test job to succeed
|
|
env:
|
|
SUITES_RESULT: ${{ needs.suites.result }}
|
|
ENGINE_RESULT: ${{ needs.engine-tests.result }}
|
|
run: bash scripts/check-ci-results.sh "$SUITES_RESULT" "$ENGINE_RESULT"
|
|
|
|
windows-desktop:
|
|
# WinForms tests need a Windows desktop runtime; the Linux job can only
|
|
# cross-compile them. FrontEnd.Tests also run here, beside the desktop build.
|
|
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: Test acceptance evidence checker
|
|
run: python scripts/test_windows_acceptance.py -v
|
|
- name: Verify named Windows acceptance coverage
|
|
if: always()
|
|
run: python scripts/windows_acceptance.py --results TestResults
|
|
- 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
|