CI: Add Windows matrix leg with platform-specific test filtering#147
CI: Add Windows matrix leg with platform-specific test filtering#147
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a cross-platform GitHub Actions CI workflow to cover both Linux and Windows builds/tests for Magma, with OS-specific steps for platform-dependent components.
Changes:
- Introduces an OS matrix (
ubuntu-latest,windows-latest) for the main build-and-test job. - Runs platform-agnostic test projects on both OSes, while gating NetMap tests to Linux.
- Adds a Windows-only build verification step for the
Magma.WinTun.TcpHostsample and sets explicitcontents: readpermissions.
.github/workflows/ci.yml
Outdated
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '10.0.x' | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore | ||
|
|
||
| - name: Build | ||
| run: dotnet build --no-restore | ||
|
|
||
| - name: Test (Common) | ||
| run: dotnet test test/Magma.Common.Facts/Magma.Common.Facts.csproj --no-build --verbosity normal | ||
|
|
||
| - name: Test (Link) | ||
| run: dotnet test test/Magma.Link.Facts/Magma.Link.Facts.csproj --no-build --verbosity normal | ||
|
|
||
| - name: Test (Internet.Ip) | ||
| run: dotnet test test/Magma.Internet.Ip.Facts/Magma.Internet.Ip.Facts.csproj --no-build --verbosity normal | ||
|
|
||
| - name: Test (NetMap) - Linux only | ||
| if: runner.os == 'Linux' | ||
| run: dotnet test test/Magma.NetMap.Facts/Magma.NetMap.Facts.csproj --no-build --verbosity normal | ||
|
|
||
| - name: Verify WinTun.TcpHost builds - Windows only | ||
| if: runner.os == 'Windows' | ||
| run: dotnet build sample/Magma.WinTun.TcpHost/Magma.WinTun.TcpHost.csproj --no-restore |
There was a problem hiding this comment.
The steps: list is not indented under steps: (the - uses: line is aligned with steps:). This makes the workflow YAML invalid and will prevent the job from running. Indent all step items so they are children of steps:.
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Test (Common) | |
| run: dotnet test test/Magma.Common.Facts/Magma.Common.Facts.csproj --no-build --verbosity normal | |
| - name: Test (Link) | |
| run: dotnet test test/Magma.Link.Facts/Magma.Link.Facts.csproj --no-build --verbosity normal | |
| - name: Test (Internet.Ip) | |
| run: dotnet test test/Magma.Internet.Ip.Facts/Magma.Internet.Ip.Facts.csproj --no-build --verbosity normal | |
| - name: Test (NetMap) - Linux only | |
| if: runner.os == 'Linux' | |
| run: dotnet test test/Magma.NetMap.Facts/Magma.NetMap.Facts.csproj --no-build --verbosity normal | |
| - name: Verify WinTun.TcpHost builds - Windows only | |
| if: runner.os == 'Windows' | |
| run: dotnet build sample/Magma.WinTun.TcpHost/Magma.WinTun.TcpHost.csproj --no-restore | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Test (Common) | |
| run: dotnet test test/Magma.Common.Facts/Magma.Common.Facts.csproj --no-build --verbosity normal | |
| - name: Test (Link) | |
| run: dotnet test test/Magma.Link.Facts/Magma.Link.Facts.csproj --no-build --verbosity normal | |
| - name: Test (Internet.Ip) | |
| run: dotnet test test/Magma.Internet.Ip.Facts/Magma.Internet.Ip.Facts.csproj --no-build --verbosity normal | |
| - name: Test (NetMap) - Linux only | |
| if: runner.os == 'Linux' | |
| run: dotnet test test/Magma.NetMap.Facts/Magma.NetMap.Facts.csproj --no-build --verbosity normal | |
| - name: Verify WinTun.TcpHost builds - Windows only | |
| if: runner.os == 'Windows' | |
| run: dotnet build sample/Magma.WinTun.TcpHost/Magma.WinTun.TcpHost.csproj --no-restore |
There was a problem hiding this comment.
Fixed in 38faebe. All step items are now properly indented with 6 spaces under steps:.
.github/workflows/ci.yml
Outdated
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '10.0.x' |
There was a problem hiding this comment.
actions/setup-dotnet is configured with dotnet-version: '10.0.x', but the repo pins 10.0.102 via global.json. Using the global.json file (or pinning the exact version) helps ensure CI uses the same SDK as local/dev builds and avoids subtle version drift.
| dotnet-version: '10.0.x' | |
| global-json-file: global.json |
There was a problem hiding this comment.
Fixed in 38faebe. Now using global-json-file: global.json to ensure CI uses the pinned SDK version 10.0.102.
|
@copilot rebase to master |
38faebe to
51e2682
Compare
|
Closing as superseded — the CI workflow with Windows matrix support is already in master via PR #143. |
.github/workflows/directoryci.ymlworkflow file with matrix strategy forubuntu-latestandwindows-lateststeps:)global.jsonfor SDK version instead of hardcoded versionOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.