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

ci: install required .NET SDKs explicitly #98

Merged
merged 3 commits into from
May 2, 2024

Conversation

Flash0ver
Copy link
Member

@Flash0ver Flash0ver commented Apr 10, 2024

CI/CD workflows: setup-dotnet action

With PR #96 (postcondition: standard error output stream is empty) we require not only the .NET 8.0 SDK to be installed locally, but also the reference assemblies of other frameworks that our tests target (currently .NET 7.0 & .NET 6.0).
On my machine I had only the .NET 8.0 SDK and the .NET Core 3.1 SDK installed, and the new postcondition failed:

[Failure] Msbuild failed when processing the file '{..}\TestProject.csproj' with message {..}: The reference assemblies for ".NETFramework,Version=v6.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.

In order to not rely on the preinstalled software of the GitHub-hosted runners, and mirror my current local setup, let's install the dependencies explicitly.

As a side effect, we are also installing the latest .NET SDK as per global.json.
Previously the exact version was installed, disregarding the rollForward.
From Job ubuntu-22_04:

dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100/dotnet-sdk-8.0.100-linux-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.100/dotnet-sdk-8.0.100-linux-x64.tar.gz
dotnet-install: Installed version is 8.0.100
dotnet-install: Adding to current process PATH: `/usr/share/dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.

Version of NuGet.Packaging for integration tests

However, using the latest .NET SDK (currently SDK 8.0.204) also requires updating the package NuGet.Packaging to a compatible version (e.g. v6.9.1) for interceptor list integration tests to succeed. It would be tedious to keep the version of NuGet.Packaging in sync with the latest .NET SDK manually.
i.e.

.NET SDK NuGet.Packaging
8.0.1nn 6.8.0
8.0.2nn 6.9.1
8.0.3nn 6.10.*
8.0.4nn 6.11.*

Where 6.7.1 is compatible with the .NET SDK 7.0.4nn,
and 6.12.* will be compatible with the upcoming .NET SDK 9.0.100 (unless Microsoft will release a new major version of Visual Studio for .NET 9.0, so 18.0 instead of 17.12, in which case the major version of the NuGet packages will also be incremented to 7.0.*).

So I'm proposing the version range [6.*,6.12.0), where open/close brackets [] are inclusive, open/close parentheses () are exclusive, and the asterisk * resolves to the highest version available, therefore resolving to the latest compatible version for all feature bands within the .NET 8.0 release cycle.

This way developers may have any non-preview .NET 8.0 SDK installed, in accordance with our global.json, and still be able to successfully run the interceptor list integration tests locally. And CI/CD should be fine selecting the latest patch version of the .NET 8.0 SDK and also succeed.

See Package versioning
See global.json overview
Also ... I think this is the first time I am writing more documentation than actual code 😉.

@Flash0ver Flash0ver added type:cd Changes to our CD configuration files and scripts type:ci Changes to our CI configuration files and scripts scope:repo GitHub repository changelog:none No consumer observable changes (no SemVer increment) labels Apr 10, 2024
@Flash0ver Flash0ver added this to the v1.0.0-prerelease3 milestone Apr 10, 2024
@Flash0ver Flash0ver self-assigned this Apr 10, 2024
@Flash0ver
Copy link
Member Author

@Gh0stWalk3r, what do you think?

@Flash0ver Flash0ver merged commit 36c7b5c into main May 2, 2024
3 checks passed
@Flash0ver Flash0ver deleted the ci/install-dotnet-sdks-explicitly branch May 2, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:none No consumer observable changes (no SemVer increment) scope:repo GitHub repository type:cd Changes to our CD configuration files and scripts type:ci Changes to our CI configuration files and scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants