Skip to content

Comments

CI: Add Windows matrix leg with platform-conditional testing#143

Merged
benaadams merged 6 commits intomasterfrom
copilot/fix-windows-matrix-leg
Feb 11, 2026
Merged

CI: Add Windows matrix leg with platform-conditional testing#143
benaadams merged 6 commits intomasterfrom
copilot/fix-windows-matrix-leg

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

  • Create .github/workflows/ci.yml with Linux and Windows matrix
  • Configure job matrix with ubuntu-latest and windows-latest
  • Add conditional test execution: skip NetMap/AF_XDP tests on Windows
  • Add conditional test execution: skip WinTun tests on Linux (implicitly handled)
  • Configure NuGet package caching (using setup-dotnet built-in)
  • Add trigger for push to master and all PRs
  • Add explicit permissions block for security best practices
  • Fix YAML indentation and .NET SDK version per review feedback
  • Verify locally: all builds and tests pass on Linux
  • Complete code review and security scanning
Original prompt

This section details on the original issue you should resolve

<issue_title>CI: Windows matrix leg</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 11, 2026 04:52
Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com>
Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Windows matrix leg in CI CI: Add Windows matrix leg with platform-conditional testing Feb 11, 2026
Copilot AI requested a review from benaadams February 11, 2026 04:57
@benaadams benaadams marked this pull request as ready for review February 11, 2026 04:58
Copilot AI review requested due to automatic review settings February 11, 2026 04:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions CI workflow to provide cross-platform coverage for Magma’s Linux- and Windows-specific components, ensuring the solution is built and tests are executed appropriately per runner OS.

Changes:

  • Introduces an OS matrix (ubuntu-latest, windows-latest) with restore/build/test steps.
  • Runs all tests on Linux, while running a curated subset of test projects on Windows to avoid Linux-only test projects.
  • Adds a Windows-only build verification step for the WinTun sample and sets minimal workflow permissions.

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-dotnet installs 10.0.x, but global.json pins the repo to SDK 10.0.102 (roll-forward only within the same feature band). If setup-dotnet installs a different feature band (e.g., 10.0.3xx), dotnet build/test can fail because the required SDK isn’t present. Use 10.0.102 (or a 10.0.1xx range) to match global.json.

Suggested change
dotnet-version: '10.0.x'
dotnet-version: '10.0.102'

Copilot uses AI. Check for mistakes.
Comment on lines 32 to 38
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NuGet cache path: ~/.nuget/packages is not reliably portable on Windows runners (the cache action doesn’t consistently expand ~ on Windows). Prefer actions/setup-dotnet's built-in NuGet caching (cache: true) or cache ${{ env.USERPROFILE }}\.nuget\packages / ${{ env.NUGET_PACKAGES }} after setting it explicitly.

Copilot uses AI. Check for mistakes.
@benaadams
Copy link
Member

@copilot apply changes based on the comments in this thread

@benaadams
Copy link
Member

@copilot try again

- Fix YAML indentation: properly indent steps under steps key
- Use exact .NET SDK version (10.0.102) to match global.json
- Replace manual NuGet cache with setup-dotnet built-in cache
- Remove redundant WinTun sample build verification step

Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 11, 2026

@copilot try again

Applied all review feedback in commit 85cd4f8:

  • Fixed YAML indentation (steps properly nested under steps:)
  • Changed .NET SDK version to 10.0.102 to match global.json
  • Replaced manual NuGet cache with setup-dotnet built-in cache: true
  • Removed redundant WinTun sample verification step

Copy link
Member

@benaadams benaadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both CI jobs fail at the Setup .NET step with:

Dependencies lock file is not found in /home/runner/work/Magma/Magma. Supported file patterns: packages.lock.json

The actions/setup-dotnet@v4 with cache: true requires a packages.lock.json file to exist in the repo for NuGet package caching. Since this project doesn't use NuGet lock files, the step fails before build/test even run.

Fix: Remove cache: true from the setup-dotnet step:

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '10.0.102'

Alternatively, if NuGet caching is desired, you'd need to either:

  1. Add <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> to Directory.Build.props and commit the generated packages.lock.json files, or
  2. Switch to actions/cache@v4 with a custom key based on **/*.csproj files instead.

benaadams and others added 2 commits February 11, 2026 12:27
Add RestorePackagesWithLockFile to Directory.Build.props and commit
generated packages.lock.json files so setup-dotnet cache: true works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The setup-dotnet action looks for packages.lock.json in the repo root
by default. Point it at the per-project lock files with a glob.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@benaadams benaadams merged commit 0bddc04 into master Feb 11, 2026
2 checks passed
@benaadams benaadams deleted the copilot/fix-windows-matrix-leg branch February 11, 2026 12:32
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.

CI: Windows matrix leg

2 participants