Skip to content

Commit 7c8494a

Browse files
committed
Add PowerShell 7.3 with net7.0 to test matrix
1 parent 6ef2c21 commit 7c8494a

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

.vsts-ci/templates/ci-general.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ steps:
1212
pwsh: ${{ parameters.pwsh }}
1313

1414
- task: UseDotNet@2
15-
displayName: Install .NET 6.0.x SDK
15+
displayName: Install .NET 7.0.x SDK
1616
inputs:
1717
packageType: sdk
18+
version: 7.0.x
19+
performMultiLevelLookup: true
20+
21+
- task: UseDotNet@2
22+
displayName: Install .NET 6.0.x runtime
23+
inputs:
24+
packageType: runtime
1825
version: 6.0.x
1926
performMultiLevelLookup: true
2027

PowerShellEditorServices.build.ps1

+9-4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ $script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditor
4141
$script:NetRuntime = @{
4242
PS7 = 'netcoreapp3.1'
4343
PS72 = 'net6.0'
44+
PS73 = 'net7.0'
4445
Desktop = 'net462'
4546
Standard = 'netstandard2.0'
4647
}
@@ -174,7 +175,7 @@ Task Build FindDotNet, CreateBuildInfo, {
174175

175176
Task Test TestServer, TestE2E
176177

177-
Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72
178+
Task TestServer TestServerWinPS, TestServerPS7, TestServerPS72, TestServerPS73
178179

179180
# NOTE: While these can run under `pwsh.exe` we only want them to run under
180181
# `powershell.exe` so that the CI time isn't doubled.
@@ -197,12 +198,16 @@ Task TestServerPS72 -If ($PSVersionTable.PSEdition -eq "Core") Build, SetupHelpF
197198
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }
198199
}
199200

201+
Task TestServerPS73 -If ($PSVersionTable.PSEdition -eq "Core") Build, SetupHelpForTests, {
202+
Set-Location .\test\PowerShellEditorServices.Test\
203+
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS73 }
204+
}
205+
200206
Task TestE2E Build, SetupHelpForTests, {
201207
Set-Location .\test\PowerShellEditorServices.Test.E2E\
202208

203209
$env:PWSH_EXE_NAME = if ($IsCoreCLR) { "pwsh" } else { "powershell" }
204-
$NetRuntime = if ($IsAppleM1 -or $script:IsArm64) { $script:NetRuntime.PS72 } else { $script:NetRuntime.PS7 }
205-
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $NetRuntime }
210+
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }
206211

207212
if (!$script:IsNix) {
208213
if (-not [Security.Principal.WindowsIdentity]::GetCurrent().Owner.IsWellKnown("BuiltInAdministratorsSid")) {
@@ -213,7 +218,7 @@ Task TestE2E Build, SetupHelpForTests, {
213218
try {
214219
Write-Host "Running end-to-end tests in Constrained Language Mode."
215220
[System.Environment]::SetEnvironmentVariable("__PSLockdownPolicy", "0x80000007", [System.EnvironmentVariableTarget]::Machine);
216-
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS7 }
221+
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }
217222
} finally {
218223
[System.Environment]::SetEnvironmentVariable("__PSLockdownPolicy", $null, [System.EnvironmentVariableTarget]::Machine);
219224
}

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0",
3+
"version": "7.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": true
66
}

test/PowerShellEditorServices.Test/PowerShellEditorServices.Test.csproj

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net6.0;netcoreapp3.1;net462</TargetFrameworks>
5+
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1;net462</TargetFrameworks>
66
<AssemblyName>Microsoft.PowerShell.EditorServices.Test</AssemblyName>
77
<TargetPlatform>x64</TargetPlatform>
88
</PropertyGroup>
@@ -12,20 +12,30 @@
1212
<ProjectReference Include="..\PowerShellEditorServices.Test.Shared\PowerShellEditorServices.Test.Shared.csproj" />
1313
</ItemGroup>
1414

15-
<!-- This is for testing PowerShell 7.2 LTS -->
15+
<!-- Latest PowerShell -->
16+
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
17+
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.0" />
18+
</ItemGroup>
19+
20+
<!-- PowerShell LTS-Current -->
1621
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
1722
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.7" />
1823
</ItemGroup>
1924

20-
<!-- This is for testing PowerShell 7.0 LTS and so needs to be 7.0.x -->
25+
<!-- PowerShell LTS -->
2126
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
2227
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.13" />
2328
</ItemGroup>
2429

30+
<!-- Windows PowerShell 5.1 -->
2531
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
2632
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies" Version="1.1.0" />
2733
</ItemGroup>
2834

35+
<PropertyGroup Condition=" '$(TargetFramework)' != 'net462' ">
36+
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
37+
</PropertyGroup>
38+
2939
<ItemGroup>
3040
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
3141
<PackageReference Include="xunit" Version="2.4.2" />
@@ -48,7 +58,4 @@
4858
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
4959
</ItemGroup>
5060

51-
<PropertyGroup Condition=" '$(TargetFramework)' != 'net462' ">
52-
<DefineConstants>$(DefineConstants);CoreCLR</DefineConstants>
53-
</PropertyGroup>
5461
</Project>

0 commit comments

Comments
 (0)