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

Updated build and integration test scripts to include .NET 9 #1404

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1c2648e
Updated build and integration test scripts to include .NET 9
WhitWaldo Nov 10, 2024
58b12e3
Removed unused matrix values
WhitWaldo Nov 10, 2024
804a9d6
Reverted some .NET 8 requirement
WhitWaldo Nov 10, 2024
9a1b3a3
Updated setup-dotnet to use latest action version + updated script to…
WhitWaldo Nov 10, 2024
1b77c0a
Removed unnecessary secondary build step
WhitWaldo Nov 10, 2024
dc8d091
Updating TFM moniker
WhitWaldo Nov 10, 2024
0bc6170
Added test to install VStest
WhitWaldo Nov 10, 2024
a725d8c
Rolling back use of tool as it doesn't independently exist outside of…
WhitWaldo Nov 10, 2024
df627f9
Added .NET 9 to build targets
WhitWaldo Nov 10, 2024
70916bc
Added .NET 9 to target frameworks across solution
WhitWaldo Nov 10, 2024
378ac9f
I understand the reason for the required install step now - adding it…
WhitWaldo Nov 10, 2024
1029619
Placing install steps before build
WhitWaldo Nov 10, 2024
ec3e953
Updating global.json
WhitWaldo Nov 10, 2024
763dc75
Disabled analyzer errors in unit tests
WhitWaldo Nov 10, 2024
37219db
Added .NET 9 to test
WhitWaldo Nov 10, 2024
9b7f68c
Changed from #pragma error to #pragma warning
WhitWaldo Nov 10, 2024
ed01370
Fixed unit tests to resolve analyzer warning
WhitWaldo Nov 10, 2024
b293f31
Updated integration test to always include .NET 8 and .NET 9 installs
WhitWaldo Nov 10, 2024
2ac5207
Falling back to add separate .NET 9 support
WhitWaldo Nov 10, 2024
056c7d4
Updated referenced projects to target appropriate frameworks
WhitWaldo Nov 10, 2024
9a21e82
Added all target frameworks back to Dapr.Commono
WhitWaldo Nov 10, 2024
677b982
Added warnings to fix nullability analyzer warnings when targeting .N…
WhitWaldo Nov 10, 2024
6bc4794
Merge branch 'master' into net-9
WhitWaldo Nov 20, 2024
df39909
Merge branch 'master' into net-9
WhitWaldo Nov 26, 2024
1be87d6
Updated build step to use .NET 9 instead
WhitWaldo Nov 26, 2024
a7e15da
Fixed cloud event middleware tests - the ApplicationBuilder requires …
WhitWaldo Nov 26, 2024
e32c9a6
Including target for .NET 6, 7, 8 and 9
WhitWaldo Nov 26, 2024
0189ffc
Trialing fix to E2E integration test - excluding use of AppWebApplica…
WhitWaldo Nov 26, 2024
3635f5e
Reverting as it breaks the other .NET versions
WhitWaldo Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/workflows/itests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet-version: ['6.0', '7.0', '8.0']
dotnet-version: ['6.0', '7.0', '8.0', '9.0']
include:
- dotnet-version: '6.0'
display-name: '.NET 6.0'
Expand All @@ -37,6 +37,11 @@ jobs:
framework: 'net8'
prefix: 'net8'
install-version: '8.0.x'
- dotnet-version: '9.0'
display-name: '.NET 9.0'
framework: 'net9'
prefix: 'net9'
install-version: '9.0.x'
env:
NUPKG_OUTDIR: bin/Release/nugets
GOVER: 1.20.3
Expand Down Expand Up @@ -103,14 +108,23 @@ jobs:
- name: Parse release version
run: python ./.github/scripts/get_release_version.py
- name: Setup ${{ matrix.display-name }}
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.install-version }}
- name: Setup .NET 8.0 # net8 is always required.
uses: actions/setup-dotnet@v1
dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available
- name: Setup .NET 8 (required)
uses: actions/setup-dotnet@v3
if: ${{ matrix.install-version != '8.0.x' }}
with:
dotnet-version: 8.0.x
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Setup .NET 9 (required)
uses: actions/setup-dotnet@v3
if: ${{ matrix.install-version != '9.0.x' }}
with:
dotnet-version: '9.0.x'
dotnet-quality: 'ga'
- name: Build
- name: Build
# disable deterministic builds, just for test run. Deterministic builds break coverage for some reason
run: dotnet build --configuration release /p:GITHUB_ACTIONS=false
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/sdk_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ jobs:
- name: Parse release version
run: python ./.github/scripts/get_release_version.py
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
dotnet-quality: 'ga'
- name: Build
run: dotnet build --configuration release
- name: Generate Packages
Expand All @@ -43,39 +44,49 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet-version: ['6.0', '7.0', '8.0']
dotnet-version: ['6.0', '7.0', '8.0', '9.0']
include:
- dotnet-version: '6.0'
install-3: false
display-name: '.NET 6.0'
framework: 'net6'
prefix: 'net6'
install-version: '6.0.x'
- dotnet-version: '7.0'
install-3: false
display-name: '.NET 7.0'
framework: 'net7'
prefix: 'net7'
install-version: '7.0.x'
- dotnet-version: '8.0'
install-3: false
display-name: '.NET 8.0'
framework: 'net8'
prefix: 'net8'
install-version: '8.0.x'
- dotnet-version: '9.0'
display-name: '.NET 9.0'
framework: 'net9'
prefix: 'net9'
install-version: '9.0.x'
steps:
- uses: actions/checkout@v1
- name: Parse release version
run: python ./.github/scripts/get_release_version.py
- name: Setup ${{ matrix.display-name }}
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.install-version }}
- name: Setup .NET 8.0 # net8 is always required.
uses: actions/setup-dotnet@v1
dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available
- name: Setup .NET 8 (required)
uses: actions/setup-dotnet@v3
if: ${{ matrix.install-version != '8.0.x' }}
with:
dotnet-version: 8.0.x
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Setup .NET 9 (required)
uses: actions/setup-dotnet@v3
if: ${{ matrix.install-version != '9.0.x' }}
with:
dotnet-version: '9.0.x'
dotnet-quality: 'ga'
- name: Build
# disable deterministic builds, just for test run. Deterministic builds break coverage for some reason
run: dotnet build --configuration release /p:GITHUB_ACTIONS=false
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_comment": "This policy allows the 8.0.100 SDK or patches in that family.",
"sdk": {
"version": "8.0.100",
"rollForward": "minor"
"version": "9.0.100-rc.2",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion src/Dapr.Common/Dapr.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6;net7;net8</TargetFrameworks> <!-- Supports .NET 7 for Dapr.Workflow -->
<TargetFrameworks>net6;net7;net8;net9</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Dapr.Jobs/Dapr.Jobs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6;net8</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Dapr.Jobs</PackageId>
Expand Down
6 changes: 6 additions & 0 deletions src/Dapr.Jobs/Models/DaprJobSchedule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public static DaprJobSchedule FromCronExpression(CronExpressionBuilder builder)
/// <returns></returns>
public static DaprJobSchedule FromDateTime(DateTimeOffset scheduledTime)
{
#if NET6_0
ArgumentNullException.ThrowIfNull(scheduledTime, nameof(scheduledTime));
#endif
return new DaprJobSchedule(scheduledTime.ToString("O"));
}

Expand All @@ -77,7 +79,9 @@ public static DaprJobSchedule FromDateTime(DateTimeOffset scheduledTime)
/// <param name="expression">The systemd Cron-like expression indicating when the job should be triggered.</param>
public static DaprJobSchedule FromExpression(string expression)
{
#if NET6_0
ArgumentNullException.ThrowIfNull(expression, nameof(expression));
#endif
return new DaprJobSchedule(expression);
}

Expand All @@ -87,7 +91,9 @@ public static DaprJobSchedule FromExpression(string expression)
/// <param name="duration">The duration interval.</param>
public static DaprJobSchedule FromDuration(TimeSpan duration)
{
#if NET6_0
ArgumentNullException.ThrowIfNull(duration, nameof(duration));
#endif
return new DaprJobSchedule(duration.ToDurationString());
}

Expand Down
1 change: 1 addition & 0 deletions src/Dapr.Protos/Dapr.Protos.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6;net7;net8;net9</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Description>This package contains the reference protos used by develop services using Dapr.</Description>
Expand Down
1 change: 1 addition & 0 deletions src/Dapr.Workflow/Dapr.Workflow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- NuGet configuration -->
<PropertyGroup>
<!-- NOTE: Workflows targeted .NET 7 (whereas other packages did not, so we must continue until .NET 7 EOL). -->
<TargetFrameworks>net6;net7;net8;net9</TargetFrameworks>
<Nullable>enable</Nullable>
<PackageId>Dapr.Workflow</PackageId>
<Title>Dapr Workflow Authoring SDK</Title>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="$(MSBuildThisFileDirectory)..\properties\dapr_nuget.props" />

<PropertyGroup>
<TargetFrameworks>net6;net8</TargetFrameworks>
<TargetFrameworks>net6;net8;net9</TargetFrameworks>
<OutputPath>$(RepoRoot)bin\$(Configuration)\prod\$(MSBuildProjectName)\</OutputPath>

<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public Test()
7;
#elif NET8_0
8;
#elif NET9_0
9;
#endif

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/cloudevents+json");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();

Check failure on line 74 in test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs

View workflow job for this annotation

GitHub Actions / Test .NET 9.0

Dapr.AspNetCore.IntegrationTest.CloudEventsIntegrationTest.CanSendStructuredCloudEvent: System.Net.Http.HttpRequestException : Response status code does not indicate success: 500 (Internal Server Error).

var userInfo = await JsonSerializer.DeserializeAsync<UserInfo>(await response.Content.ReadAsStreamAsync(), this.options);
userInfo.Name.Should().Be("jimmy");
Expand Down Expand Up @@ -102,7 +102,7 @@
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/cloudevents+json");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();

Check failure on line 105 in test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs

View workflow job for this annotation

GitHub Actions / Test .NET 9.0

Dapr.AspNetCore.IntegrationTest.CloudEventsIntegrationTest.CanSendStructuredCloudEvent_WithContentType: System.Net.Http.HttpRequestException : Response status code does not indicate success: 500 (Internal Server Error).

var userInfo = await JsonSerializer.DeserializeAsync<UserInfo>(await response.Content.ReadAsStreamAsync(), this.options);
userInfo.Name.Should().Be("jimmy");
Expand Down Expand Up @@ -146,7 +146,7 @@
using (var factory = new AppWebApplicationFactory())
{
var httpClient = factory.CreateClient(new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions { HandleCookies = false });

var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user")
{
Content = new StringContent(
Expand All @@ -158,10 +158,10 @@
Encoding.UTF8)
};
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();

Check failure on line 163 in test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs

View workflow job for this annotation

GitHub Actions / Test .NET 9.0

Dapr.AspNetCore.IntegrationTest.CloudEventsIntegrationTest.CanSendBinaryCloudEvent_WithContentType: System.Net.Http.HttpRequestException : Response status code does not indicate success: 500 (Internal Server Error).

var userInfo = await JsonSerializer.DeserializeAsync<UserInfo>(await response.Content.ReadAsStreamAsync(), this.options);
userInfo.Name.Should().Be("jimmy");
}
Expand Down
Loading
Loading