Repository navigation
Add a Windows CI workflow that builds and tests with GDI+ and WinForms - #469
Merged
Merged
Conversation
#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
Collaborator
Author
|
Merged
The fix is an alias, Generated by Claude Code |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thenet8.0-windowstarget ofCADability.Testsdefines. So far they only ran on a developer's Windows machine:CADability.Forms(Move the GDI+ conversions of the geometry types into CADability.Forms #465);ProjectTest;What
New workflow
.github/workflows/windows-ci.yml. It runs on every pull request, on every push tomaster, and by hand (workflow_dispatch).Runner:
windows-latest, checkout withsubmodules: recursive, .NET 8 and 10.Steps:
CADability.Forms;CADability.Tests(here asnet8.0-windows, withCADability.Forms) andCADability.ImportTests;.trxresults 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
DxfDimensionTestThe first Windows run showed 4 failing
ImportTests:import_dxf_dimension_uses_the_standard_style_of_the_fileimport_dxf_degenerate_dimension_keeps_its_blockimport_dxf_dimension_text_override_keeps_the_measurementimport_dxf_dimension_translates_the_angle_formatCause: 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