[Windows] Build currently-supported targets in CI#3644
Conversation
| shell: pwsh | ||
| - name: Pull Docker image | ||
| run: docker pull swift:6.3-windowsservercore-ltsc2022 | ||
| - name: Build currently-supported targets |
There was a problem hiding this comment.
@rnro is there a more canonical way to do this?
There was a problem hiding this comment.
You can enable Windows in the unit-tests job above with a boolean flag, or if you don't want testing use swift_test_matrix.yml as a custom matrix job, disabling non-windows platforms and with swift build as the build command.
There was a problem hiding this comment.
Sorry, I meant for building specific targets. Would the matrix job be more suitable than what Jake has proposed?
There was a problem hiding this comment.
I believe so, you can focus on just what is the intent of the job and have the Swift/Windows version concerns, configuration and docker shenanigans delegated. You'd just have
MATRIX_WINDOWS_COMMAND: swift build --target _NIOBase64 --target _NIOConcurrency --target _NIODataStructures --target NIOConcurrencyHelpers --target NIOCore --target NIOEmbedded --target NIOFoundationCompat --target NIOFoundationEssentialsCompat --target NIOHTTP1 --target NIOTLS --target NIOWebSocket"
You'd have to also specify
MATRIX_LINUX_6_0_ENABLED: false
...
MATRIX_LINUX_6_3_ENABLED: false
unless a general "disable Linux" flag was added as an enhancement.
There was a problem hiding this comment.
Updated the PR. Is this what you were looking for?
ed434e6 to
9cf1a95
Compare
Add a Windows PR/main CI job that builds the targets which compile cleanly today: _NIOBase64, _NIOConcurrency, _NIODataStructures, NIOConcurrencyHelpers, NIOCore, NIOEmbedded, NIOFoundationCompat, NIOFoundationEssentialsCompat, NIOHTTP1, NIOTLS, NIOWebSocket. The remaining targets (NIOPosix, NIO, NIOTestUtils, downstream tests, examples) still fail on Windows and are not yet covered. The existing unit-tests workflow path runs swift test, which does not accept --target, so flipping windows_6_3_enabled there would attempt to test the whole package and fail. Instead this delegates to the shared swift_test_matrix workflow with a custom matrix that disables all Linux versions, enables Windows 6.3, and overrides MATRIX_WINDOWS_COMMAND with the targeted swift build invocation. Docker image, runner, and container-setup concerns stay in the shared machinery. As more targets come up on Windows we will extend the list, then retire this job in favor of windows_6_3_enabled when swift test of the whole package is green.
Add a Windows PR/main CI job that builds the targets which compile cleanly today: _NIOBase64, _NIOConcurrency, _NIODataStructures, NIOConcurrencyHelpers, NIOCore, NIOEmbedded, NIOFoundationCompat, NIOFoundationEssentialsCompat, NIOHTTP1, NIOTLS, NIOWebSocket. The remaining targets (NIOPosix, NIO, NIOTestUtils, downstream tests, examples) still fail on Windows and are not yet covered.
The existing unit-tests workflow path runs swift test, which does not accept --target, so flipping windows_6_3_enabled there would attempt to test the whole package and fail. Instead this is an inline job that runs swift build with explicit --target flags. As more targets come up on Windows we'll extend the list, then eventually retire this job in favor of windows_6_3_enabled when swift test of the whole package is green.