Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.NET] Reduce NuGet size by only targeting .NET Standard 2.0 #363

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

obligaron
Copy link
Contributor

🤔 What's changed?

  • Reduce NuGet size by only targeting .NET Standard 2.0
  • Only run windows specific test environments (.NET Framework 4.7.2) on windows
  • Updated runner to ubuntu-latest

⚡️ What's your motivation?

Fixes #349

The .NET tests run on different runtimes (.NET8, .NET9, .NET Framework 4.7.2).
In the github workflow (CI), Ubuntu is used to run the tests.
But Ubuntu/Linux doesn't have a Windows-only .NET Framework 4.7.2 installed.
Instead, Ubuntu used Mono to run the tests. However, as of Ubuntu 24.04, Mono is no longer installed. See actions/runner-images#10636.
This means that even on Ubuntu-22.04 the Gherkin implementation is not tested on the real .NET Framework.
This PR changes that the .NET Framework 4.7.2 runtime is only tested on Windows machines.

On the other hand, we currently have the Gherkin implementation in two flavors (.NET 8 and .NET Standard 2.0).
Both flavors use identical code and the .NET 8 specific target framework can be dropped because .NET Standard 2.0 can also be used in .NET 8 and .NET 9.
This reduces the size of NuGet package and ensures that we test all binaries we ship with the tests we run in the github workflow (CI).

Microsoft also recommends targeting only .NET Standard 2.0 if no additional features or specific APIs are required. See When to target netx.0 vs. netstandard and Cross-platform targeting.

In Reqnroll, the target framework has also been reduced to .NET Standard 2.0 only.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

@Romfos I checked #67, but the linked Microsoft recommendation only applies to updating if you were already using one of the older frameworks (e.g. .NET 5). Am I missing something?

@gasparnagy Do you think this could be a problem in any way?

📋 Checklist:


This text was originally generated from a template, then edited by hand. You can modify the template here.

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.

.NET workflows (including test-codegen) incompatible with ubuntu-24.04 runner (now ubuntu-latest)
1 participant