Skip to content

Add a Windows CI workflow that builds and tests with GDI+ and WinForms - #469

Merged
dsn27 merged 4 commits into
masterfrom
ci/windows-build-and-test
Oct 19, 2026
Merged

dsn27 merged 4 commits into
masterfrom
ci/windows-build-and-test

Conversation

@dsn27

@dsn27 dsn27 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #412: the counterpart of the Linux CI (#461).

Why

The Linux CI compiles some tests out: those that need GDI+, WinForms or OpenGL. They are guarded by WINDOWS, which only the net8.0-windows target of CADability.Tests defines. So far they only ran on a developer's Windows machine:

What

New workflow .github/workflows/windows-ci.yml. It runs on every pull request, on every push to master, and by hand (workflow_dispatch).

Runner: windows-latest, checkout with submodules: recursive, .NET 8 and 10.

Steps:

  • builds the kernel and CADability.Forms;
  • runs CADability.Tests (here as net8.0-windows, with CADability.Forms) and CADability.ImportTests;
  • uploads the .trx results as an artifact.

The Windows run is a separate workflow, so a failure on Windows does not hide the Linux result and vice versa.

Test fix included: line endings in DxfDimensionTest

The first Windows run showed 4 failing ImportTests:

  • import_dxf_dimension_uses_the_standard_style_of_the_file
  • import_dxf_degenerate_dimension_keeps_its_block
  • import_dxf_dimension_text_override_keeps_the_measurement
  • import_dxf_dimension_translates_the_angle_format

Cause: these tests edit their verbatim-string fixtures with Replace("...\n..."). With * text=auto, Windows checks the file out with CRLF, so the search text is not found. The tests then fail on their own "fixture should have been changed" assertion. Linux checkouts have LF, which is why nobody noticed.

Fix: the fixtures are normalized to LF before they are edited (Lf(...)). The file already does the same for the DXF written in another test. This is a test-only change.

Reproduced locally: with the test file converted to CRLF, the 4 tests fail exactly as in CI without the fix, and pass with it. They also pass with LF.

First run on Windows (before the fix)

  • CADability.Tests (net8.0-windows): 627 passed, 2 skipped, 0 failed. The OpenGL rendering tests against reference bitmaps pass on the hosted runner.
  • CADability.ImportTests: 84 passed, 4 failed (the line-ending issue above).

No change to product code or the csproj version.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5

#412)

The Linux CI compiles the tests that need GDI+, WinForms or OpenGL out
(they are guarded by WINDOWS, which only the net8.0-windows target of
CADability.Tests defines). The new workflow builds the kernel and
CADability.Forms on windows-latest and runs both test projects there,
so these tests run on every pull request as well: the GDI+ conversions
of CADability.Forms, the rendering against reference bitmaps and,
next, the comparison of the GDI and the managed glyph outlines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5
…heckout

Four tests of DxfDimensionTest edit their verbatim-string fixtures with
Replace("...\n..."). With "* text=auto" Windows checks the file out with
CRLF, the search text is not found, and the tests fail on their own
"fixture should have been changed" assertion. The new Windows CI showed
it; Linux checkouts have LF and never noticed. The fixtures are now
normalized to LF before they are edited, as the file already does for
the DXF written in another test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5
…build

The test from #497 uses PaintEventArgs with 'using CADability.Substitutes'.
The Windows build of the tests sets UseWindowsForms, which brings
System.Windows.Forms.PaintEventArgs into scope as well, so the Windows job
failed with CS0104. An alias picks the substitute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5

dsn27 commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Merged master and added one fix to keep this job green.

RendererRecoveryTests.cs from #497 uses PaintEventArgs with using CADability.Substitutes. The Windows build of the tests sets UseWindowsForms, which also brings System.Windows.Forms.PaintEventArgs into scope, so the test project failed to compile with CS0104. master does not show this because it has no Windows job yet. Merging this PR would have made master red on Windows.

The fix is an alias, using PaintEventArgs = CADability.Substitutes.PaintEventArgs;. I reproduced the error locally with -p:OS=Windows_NT and checked that the build passes with the alias.


Generated by Claude Code

@dsn27
dsn27 merged commit 566ab9c into master Oct 19, 2026
2 checks passed
@dsn27
dsn27 deleted the ci/windows-build-and-test branch October 19, 2026 06:15
@dsn27 dsn27 mentioned this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants