Skip to content

Commit f604488

Browse files
authored
Update to .NET 9 GA. Update some test dependencies. (#2990)
* Update to .NET 9 GA. Update some test dependencies. * Remove installing extra SDKs in YAML. * Add TargetNetNext flag. * Update template-Build-run-tests-sign.yml * Nit. * Update aot-check.yml * Update yaml. * Fix AOT test. * Add strong name bypass
1 parent 658e4e5 commit f604488

File tree

12 files changed

+50
-63
lines changed

12 files changed

+50
-63
lines changed

.github/workflows/aot-check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ on:
1414
jobs:
1515
analyze:
1616
runs-on: windows-latest
17-
name: Wilson GitHub AOT check
17+
name: "AOT check"
1818

1919
steps:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 1
2424

25+
- name: Setup .NET 9.0.x
26+
uses: actions/[email protected]
27+
with:
28+
dotnet-version: 9.0.x
29+
2530
- name: Runs powershell script
2631
id: aot-powershell
2732
run: build\test-aot.ps1 'net8.0'

.github/workflows/dotnetcore.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: .NET Core
1+
name: "Run unit tests"
22

33
permissions:
44
contents: read
@@ -18,48 +18,43 @@ on:
1818
- dev
1919

2020
env:
21-
TargetNet9: True
22-
TargetNet8: True
21+
TargetNetNext: True
2322

2423
jobs:
2524
build:
2625
runs-on: windows-latest
27-
continue-on-error: true
28-
name: Wilson GitHub Action Test
26+
continue-on-error: false
27+
name: "Build and run unit tests"
2928
steps:
3029
- name: Checkout repository
3130
uses: actions/[email protected]
32-
33-
- name: Setup .NET 6.0.x
34-
uses: actions/[email protected]
35-
with:
36-
dotnet-version: 6.0.x
37-
- name: Setup .NET 8.0.x
38-
uses: actions/[email protected]
39-
with:
40-
dotnet-version: 8.0.x
41-
- name: Setup .NET 9.0.x
42-
uses: actions/[email protected]
31+
32+
- name: Setup .NET 9.x
33+
uses: actions/[email protected]
4334
with:
44-
dotnet-version: 9.0.100-rc.2.24474.11
35+
dotnet-version: 9.x
36+
37+
- name: Strong name bypass
38+
run: |
39+
regedit /s .\build\strongNameBypass.reg
4540
4641
- name: Run the tests
4742
run: dotnet test Wilson.sln --collect:"XPlat Code Coverage" --settings:./build/CodeCoverage.runsettings
4843

4944
- name: Create code coverage report
5045
run: |
51-
dotnet tool install -g dotnet-reportgenerator-globaltool
46+
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.4.1
5247
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura'
5348
54-
- name: Write Coverage to Job Summary
49+
- name: Write coverage to job summary
5550
shell: bash
5651
run: |
5752
cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
5853
echo "COMMENT_CONTENT_ENV_VAR<<EOF" >> $GITHUB_ENV
5954
echo $(cat CodeCoverage/SummaryGithub.md) >> $GITHUB_ENV
6055
echo "EOF" >> $GITHUB_ENV
6156
62-
- name: Comment Coverage in PR
57+
- name: Comment coverage in PR
6358
uses: actions/github-script@v7
6459
id: comment
6560
with:
@@ -73,4 +68,4 @@ jobs:
7368
7469
# Run baseline package validation
7570
- name: Pack
76-
run: dotnet pack Product.proj --no-restore --no-build
71+
run: dotnet pack Product.proj --no-restore --no-build

benchmark/Microsoft.IdentityModel.Benchmarks/Microsoft.IdentityModel.Benchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<AssemblyName>Microsoft.IdentityModel.Benchmarks</AssemblyName>
55
<PackageId>Microsoft.IdentityModel.Benchmarks</PackageId>
66
<OutputType>Exe</OutputType>
7-
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
8-
<TargetFrameworks Condition="'$(TargetNet9)'== 'True'">$(TargetFrameworks); net9.0</TargetFrameworks>
7+
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
8+
<TargetFrameworks Condition="'$(TargetNetNext)'== 'True'">$(TargetFrameworks); </TargetFrameworks>
99
<SignAssembly>True</SignAssembly>
1010
<DelaySign>True</DelaySign>
1111
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\..\build\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
<ItemGroup>
5050
<!-- Protects against sync-over-async: https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/index.md. -->
51-
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.9.28" PrivateAssets="all" />
51+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" PrivateAssets="all" />
5252
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All"/>
5353
</ItemGroup>
5454

build/dependenciesTest.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
<BannedApiAnalyzersVersion>3.3.4</BannedApiAnalyzersVersion>
55
<DotNetCoreAppRuntimeVersion>2.1.30</DotNetCoreAppRuntimeVersion>
66
<MicrosoftAzureKeyVaultCryptographyVersion>3.0.5</MicrosoftAzureKeyVaultCryptographyVersion>
7-
<MicrosoftNETTestSdkVersion>17.11.0</MicrosoftNETTestSdkVersion>
7+
<MicrosoftNETTestSdkVersion>17.11.1</MicrosoftNETTestSdkVersion>
88
<NetStandardVersion>2.0.3</NetStandardVersion>
99
<NewtonsoftVersion>13.0.3</NewtonsoftVersion>
1010
<SystemNetHttp>4.3.4</SystemNetHttp>
1111
<SystemSecurityClaimsVersion>4.3.0</SystemSecurityClaimsVersion>
1212
<SystemTextJson>8.0.5</SystemTextJson>
1313
<SystemTextRegularExpressions>4.3.1</SystemTextRegularExpressions>
14-
<XunitRunnerConsoleVersion>2.9.0</XunitRunnerConsoleVersion>
14+
<XunitRunnerConsoleVersion>2.9.2</XunitRunnerConsoleVersion>
1515
<XunitRunnerVisualStudioVersion>2.8.2</XunitRunnerVisualStudioVersion>
16-
<XunitVersion>2.9.0</XunitVersion>
16+
<XunitVersion>2.9.2</XunitVersion>
1717
<MicrosoftRestClientRuntimeVersion>2.3.24</MicrosoftRestClientRuntimeVersion>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
20-
<XunitRunnerVisualStudioVersion>3.0.0-pre.35</XunitRunnerVisualStudioVersion>
20+
<XunitRunnerVisualStudioVersion>3.0.0-pre.49</XunitRunnerVisualStudioVersion>
2121
</PropertyGroup>
2222
</Project>

build/targets.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<SrcTargets Condition="'$(LocalBuild)' != 'True'">net462;net472;netstandard2.0;net6.0;net8.0</SrcTargets>
4-
<SrcTargets Condition="'$(LocalBuild)' == 'True'">netstandard2.0;net8.0</SrcTargets>
5-
<SrcTargets Condition="'$(TargetNet9)' == 'True'">$(SrcTargets);net9.0</SrcTargets>
3+
<SrcTargets Condition="'$(LocalBuild)' != 'True'">net462;net472;netstandard2.0;net6.0;net8.0;net9.0</SrcTargets>
4+
<SrcTargets Condition="'$(LocalBuild)' == 'True'">netstandard2.0;net8.0;net9.0</SrcTargets>
5+
<SrcTargets Condition="'$(TargetNetNext)'== 'True'">$(SrcTargets);</SrcTargets>
66
</PropertyGroup>
77
</Project>

build/targetsTest.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<TestTargets Condition="'$(LocalBuild)' != 'True'">net462;net472;net6.0;net8.0</TestTargets>
4-
<TestTargets Condition="'$(LocalBuild)' == 'True'">net8.0</TestTargets>
5-
<TestTargets Condition="'$(TargetNet9)' == 'True'">$(TestTargets);net9.0</TestTargets>
6-
</PropertyGroup>
3+
<TestTargets Condition="'$(LocalBuild)' != 'True'">net462;net472;net6.0;net8.0;net9.0</TestTargets>
4+
<TestTargets Condition="'$(LocalBuild)' == 'True'">net8.0;net9.0</TestTargets>
5+
<TestTargets Condition="'$(TargetNetNext)'== 'True'">$(TestTargets);</TestTargets>
6+
</PropertyGroup>
77
</Project>

build/template-Build-run-tests-sign.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,11 @@ steps:
77
- script: echo $(MicrosoftIdentityModelVersion)
88
displayName: 'display MicrosoftIdentityModelVersion'
99

10-
- task: UseDotNet@2
11-
displayName: 'Use .NET Core sdk 2.x'
12-
inputs:
13-
version: 2.x
14-
installationPath: $(Agent.ToolsDirectory)/dotnet
15-
16-
- task: UseDotNet@2
17-
displayName: 'Use .NET Core sdk 6.x'
18-
inputs:
19-
version: 6.x
20-
installationPath: $(Agent.ToolsDirectory)/dotnet
21-
22-
- task: UseDotNet@2
23-
displayName: 'Use .NET Core sdk 8.x'
24-
inputs:
25-
version: 8.x
26-
installationPath: $(Agent.ToolsDirectory)/dotnet
27-
2810
- task: UseDotNet@2
2911
displayName: 'Use .Net Core SDK 9.x'
3012
inputs:
31-
version: 9.0.100-rc.2.24474.11
32-
includePreviewVersions: true
33-
condition: eq(variables['TargetNet9'], 'True')
13+
version: 9.x
14+
installationPath: $(Agent.ToolsDirectory)/dotnet
3415

3516
- task: DotNetCoreCLI@2
3617
displayName: 'dotnet --list-sdks'

build/test-aot.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ param([string]$targetNetFramework)
22

33
$projectName='Microsoft.IdentityModel.AotCompatibility.TestApp'
44
$rootDirectory = Split-Path $PSScriptRoot -Parent
5-
$publishOutput = dotnet publish $rootDirectory/test/$projectName/$projectName.csproj --self-contained -nodeReuse:false /p:UseSharedCompilation=false
5+
$publishOutput = dotnet publish $rootDirectory/test/$projectName/$projectName.csproj --self-contained --framework $targetNetFramework -nodeReuse:false /p:UseSharedCompilation=false
66

77
$actualWarningCount = 0
88

test/Microsoft.IdentityModel.AotCompatibility.TestApp/Microsoft.IdentityModel.AotCompatibility.TestApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<TargetFrameworks Condition="'$(TargetNet9)' == 'True'">$(TargetFramework); net9.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(TargetNetNext)'== 'True'">$(TargetFrameworks);</TargetFrameworks>
66
<OutputType>Exe</OutputType>
77
<PublishTrimmed>true</PublishTrimmed>
88
<TrimMode>full</TrimMode>

0 commit comments

Comments
 (0)