-
Notifications
You must be signed in to change notification settings - Fork 778
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
Enable .net6.0 build and add net6.0 target #2559
Changes from all commits
da44deb
7cb7c61
4bb1615
95fe250
ca7481b
539e1e8
aee44ae
04f9d06
cdf0b75
241302c
de1282b
725e7df
a7d0321
186d7f2
edfd114
59d1e18
8968dc2
399c931
19ed125
ed12ef6
89c0b24
a80c37a
4bd2f42
107e0e2
9c0a502
cf048c5
9e0710b
eb600f3
559bca4
7cdf850
68b2e46
86f5658
1fb2495
828f8a3
e4b12ec
1e51043
2381758
80f27e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,44 +13,80 @@ on: | |
jobs: | ||
redis-test: | ||
runs-on: ubuntu-latest | ||
# https://github.com/actions/setup-dotnet/issues/122 | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [netcoreapp3.1,net5.0] | ||
version: [netcoreapp3.1,net5.0,net6.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above, no need for 3.1.x or 5.0.x |
||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Run redis docker-compose.integration | ||
run: docker-compose --file=test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build | ||
|
||
sql-test: | ||
runs-on: ubuntu-latest | ||
# https://github.com/actions/setup-dotnet/issues/122 | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [netcoreapp3.1,net5.0] | ||
version: [netcoreapp3.1,net5.0,net6.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here as well :) |
||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Run sql docker-compose.integration | ||
run: docker-compose --file=test/OpenTelemetry.Instrumentation.SqlClient.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build | ||
|
||
w3c-trace-context-test: | ||
runs-on: ubuntu-latest | ||
# https://github.com/actions/setup-dotnet/issues/122 | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [netcoreapp3.1,net5.0] | ||
version: [netcoreapp3.1,net5.0,net6.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here as well |
||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Run W3C Trace Context docker-compose.integration | ||
run: docker-compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build | ||
|
||
otlp-exporter-test: | ||
runs-on: ubuntu-latest | ||
# https://github.com/actions/setup-dotnet/issues/122 | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: [netcoreapp3.1,net5.0] | ||
version: [netcoreapp3.1,net5.0,net6.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here. |
||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Run OTLP Exporter docker-compose.integration | ||
run: docker-compose --file=test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,19 +13,37 @@ on: | |
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
# https://github.com/actions/setup-dotnet/issues/122 | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
|
||
strategy: | ||
matrix: | ||
version: [netcoreapp3.1,net5.0] | ||
version: [netcoreapp3.1,net5.0,net6.0] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.x' | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
|
||
- name: Test ${{ matrix.version }} | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --configuration Release --no-build --logger:"console;verbosity=detailed" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,22 @@ on: | |
jobs: | ||
build-test: | ||
runs-on: windows-latest | ||
# https://github.com/actions/setup-dotnet/issues/122 | ||
env: | ||
DOTNET_MULTILEVEL_LOOKUP: 1 | ||
|
||
strategy: | ||
matrix: | ||
version: [net461,netcoreapp3.1,net5.0] | ||
version: [net461,netcoreapp3.1,net5.0,net6.0] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-dotnet@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
with: | ||
dotnet-version: '6.0.x' | ||
include-prerelease: true | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3.7' | ||
|
||
services: | ||
tests: | ||
build: | ||
args: | ||
PUBLISH_FRAMEWORK: net6.0 | ||
SDK_VERSION: 6.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ public class AspNetCoreInstrumentationOptions | |
/// </remarks> | ||
public bool RecordException { get; set; } | ||
|
||
#if NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0 | ||
#if NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0_OR_GREATER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be only:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason why we probably used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That affects .net 5 SDK, right? So now on NET6 it should work if I undersand? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it looks like it from the .NET 5 and later bullet here |
||
/// <summary> | ||
/// Gets or sets a value indicating whether RPC attributes are added to an Activity when using Grpc.AspNetCore. Default is true. | ||
/// </summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks> | ||
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, why was this needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we are using FrameworkReference, this is needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it is needed until we want to use some piece of the .NET 6 API. If the project is like this... <TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> Users on .NET 6 will still be able to use it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed - then do we remove 5.0 as well?. I have not tested but I think having only 3.1 will also work for 3.1+ apps then?. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use any .NET 6 specific feature today, but Asp.Net core 6.0 has introduced ActivitySource usage. If we want to leverage them, we either need .net6.0 target. or we use reflection to find if user is running Asp.Net Core 6.0 or newer. |
||
<Description>ASP.NET Core instrumentation for OpenTelemetry .NET</Description> | ||
<PackageTags>$(PackageTags);distributed-tracing;AspNetCore</PackageTags> | ||
<IncludeDiagnosticSourceInstrumentationHelpers>true</IncludeDiagnosticSourceInstrumentationHelpers> | ||
|
@@ -34,4 +34,8 @@ | |
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'"> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to install 3.1.x/5.0.x because they are already installed in windows-latest. I always check this:
Remember that
windows-latest
can change in the future to windows-2022, so, always have that in mind.