Skip to content

Commit d675467

Browse files
Try to force dotnet 8 for the vs2022 test run
1 parent ef65cf8 commit d675467

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/dotnet-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23+
- name: Create global.json to enforce .NET 8 for MSBuild
24+
if: inputs.dotnet-version == '8.0.x'
25+
run: echo '{"sdk":{"version":"8.0.0","rollForward":"latestFeature"}}' > global.json
26+
2327
- name: Setup .NET
2428
uses: actions/setup-dotnet@v4
2529
with:
@@ -33,8 +37,11 @@ jobs:
3337
- name: Log MSBuild version
3438
run: msbuild -version
3539

40+
- name: Log .NET version
41+
run: dotnet --info
42+
3643
- name: Build
3744
run: dotnet build DotNetBuildable.slnf /p:Configuration=Release
3845

3946
- name: Execute unit tests
40-
run: dotnet test Tests/bin/Release/ICSharpCode.CodeConverter.Tests.dll
47+
run: dotnet test Tests/Tests.csproj -c Release --framework net${{ inputs.dotnet-version == '8.0.x' && '8.0' || '10.0' }} --no-build

Tests/Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net10.0</TargetFramework>
3+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
44
<OutputType>Library</OutputType>
55
<AssemblyName>ICSharpCode.CodeConverter.Tests</AssemblyName>
66
<RootNamespace>ICSharpCode.CodeConverter.Tests</RootNamespace>

0 commit comments

Comments
 (0)