Skip to content

Commit 29ecc17

Browse files
authored
cleanup: upgrade test projects and CI to .NET 5 (#411)
1 parent 760247d commit 29ecc17

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

azure-pipelines.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ jobs:
2222
MacOS:
2323
vmImage: macOS-latest
2424
Windows:
25-
vmImage: windows-2019
25+
vmImage: windows-latest
2626
pool:
2727
vmImage: $(vmImage)
2828
steps:
2929
- task: UseDotNet@2
30-
displayName: Install .NET Core 3.1 SDK
30+
displayName: Install .NET 5 SDK
3131
inputs:
32-
version: '3.1.x'
32+
version: '5.x'
3333
packageType: sdk
34+
- task: UseDotNet@2
35+
displayName: Install .NET Core 3.1 runtime
36+
inputs:
37+
version: '3.1.x'
38+
packageType: runtime
3439
- task: UseDotNet@2
3540
displayName: Install .NET Core 2.1 runtime
3641
inputs:
@@ -54,15 +59,15 @@ jobs:
5459
- publish: artifacts/
5560
artifact: Packages
5661
displayName: Publish artifacts
57-
condition: and(succeeded(), eq('windows-2019', variables['vmImage']))
62+
condition: and(succeeded(), eq('windows-latest', variables['vmImage']))
5863
- powershell: ./docs/generate.ps1 -NoBuild
5964
displayName: Generate docs
60-
condition: and(succeeded(), eq('windows-2019', variables['vmImage']))
65+
condition: and(succeeded(), eq('windows-latest', variables['vmImage']))
6166
- powershell: ./docs/push.ps1 -a $(github-api-token-repo-write)
6267
displayName: Publish docs to GitHub Pages
6368
condition: |
6469
and(
6570
succeeded(),
66-
eq('windows-2019', variables['vmImage']),
71+
eq('windows-latest', variables['vmImage']),
6772
not(eq(variables['Build.Reason'], 'PullRequest')),
6873
eq(variables['Build.SourceBranch'], 'refs/heads/master'))

test/CommandLineUtils.Tests/McMaster.Extensions.CommandLineUtils.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
55
<TargetFrameworks Condition="'$(TestFullFramework)' != 'false'">$(TargetFrameworks);net472</TargetFrameworks>
66
</PropertyGroup>
77

@@ -15,10 +15,10 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="coverlet.collector" Version="1.3.0" />
18-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.9" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
18+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.10" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
2020
<PackageReference Include="FluentAssertions" Version="5.10.3" />
21-
<PackageReference Include="Moq" Version="4.14.7" />
21+
<PackageReference Include="Moq" Version="4.15.2" />
2222
<PackageReference Include="xunit" Version="2.4.1" />
2323
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
2424
</ItemGroup>

test/CommandLineUtils.Tests/OptionAttributeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public void BindsToStaticProperties()
241241
Assert.Equal(1, PrivateSetterProgram.StaticNumber);
242242
}
243243

244-
#if !NETCOREAPP3_1
244+
#if !NETCOREAPP3_1 && !NET5_0
245245
// .NET Core 3.0 made an intentional breaking change
246246
// see https://github.com/dotnet/coreclr/issues/21268
247247
[Fact]

test/Hosting.CommandLine.Tests/McMaster.Extensions.Hosting.CommandLine.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
55
<TargetFrameworks Condition="'$(TestFullFramework)' != 'false'">$(TargetFrameworks);net472</TargetFrameworks>
66
</PropertyGroup>
77

@@ -15,9 +15,9 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="coverlet.collector" Version="1.3.0" />
18-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.9" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
20-
<PackageReference Include="Moq" Version="4.14.7" />
18+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.10" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
20+
<PackageReference Include="Moq" Version="4.15.2" />
2121
<PackageReference Include="xunit" Version="2.4.1" />
2222
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
2323
</ItemGroup>

0 commit comments

Comments
 (0)