@@ -7,13 +7,6 @@ parameters:
77 default : false
88
99steps :
10- - task : PowerShell@2
11- displayName : PowerShell version
12- inputs :
13- targetType : inline
14- script : $PSVersionTable
15- pwsh : ${{ parameters.pwsh }}
16-
1710- checkout : self
1811
1912# NOTE: We either checkout the Git repo for PowerShellEditorServices, or we
@@ -62,19 +55,32 @@ steps:
6255 version : 6.0.x
6356 performMultiLevelLookup : true
6457
58+ # The build script is always run with PowerShell Core
6559- task : PowerShell@2
66- displayName : Build and test
60+ displayName : Build and package
6761 inputs :
6862 targetType : inline
6963 script : |
70- Get-ChildItem env:
71- Get-Module -ListAvailable Pester
7264 Install-Module InvokeBuild -Scope CurrentUser -Force
7365 Install-Module platyPS -Scope CurrentUser -Force
74- Invoke-Build -Configuration Release
66+ Invoke-Build -Configuration Release Package
7567 $PackageJson = Get-Content -Raw package.json | ConvertFrom-Json
7668 Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-$($PackageJson.version).vsix)"
7769 workingDirectory : $(Build.SourcesDirectory)/vscode-powershell
70+ pwsh : true
71+
72+ # Tests in particular are run with either PowerShell Core or Windows PowerShell
73+ - task : PowerShell@2
74+ displayName : Run unit tests
75+ inputs :
76+ targetType : inline
77+ script : |
78+ $PSVersionTable
79+ Get-ChildItem env:
80+ Get-Module -ListAvailable Pester
81+ Install-Module InvokeBuild -Scope CurrentUser -Force
82+ Invoke-Build -Configuration Release Test
83+ workingDirectory : $(Build.SourcesDirectory)/vscode-powershell
7884 pwsh : ${{ parameters.pwsh }}
7985
8086- task : PowerShell@2
8793 Write-Host '##vso[task.LogIssue type=error;]PowerShell Editor Services bits were not built in release configuration!'
8894 exit 1
8995 }
90- pwsh : ${{ parameters.pwsh }}
96+ pwsh : true
9197
9298- publish : $(vsixPath)
9399 artifact : vscode-powershell-vsix-$(System.JobId)
0 commit comments