@@ -7,13 +7,6 @@ parameters:
7
7
default : false
8
8
9
9
steps :
10
- - task : PowerShell@2
11
- displayName : PowerShell version
12
- inputs :
13
- targetType : inline
14
- script : $PSVersionTable
15
- pwsh : ${{ parameters.pwsh }}
16
-
17
10
- checkout : self
18
11
19
12
# NOTE: We either checkout the Git repo for PowerShellEditorServices, or we
@@ -62,19 +55,32 @@ steps:
62
55
version : 6.0.x
63
56
performMultiLevelLookup : true
64
57
58
+ # The build script is always run with PowerShell Core
65
59
- task : PowerShell@2
66
- displayName : Build and test
60
+ displayName : Build and package
67
61
inputs :
68
62
targetType : inline
69
63
script : |
70
- Get-ChildItem env:
71
- Get-Module -ListAvailable Pester
72
64
Install-Module InvokeBuild -Scope CurrentUser -Force
73
65
Install-Module platyPS -Scope CurrentUser -Force
74
- Invoke-Build -Configuration Release
66
+ Invoke-Build -Configuration Release Package
75
67
$PackageJson = Get-Content -Raw package.json | ConvertFrom-Json
76
68
Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-$($PackageJson.version).vsix)"
77
69
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
78
84
pwsh : ${{ parameters.pwsh }}
79
85
80
86
- task : PowerShell@2
87
93
Write-Host '##vso[task.LogIssue type=error;]PowerShell Editor Services bits were not built in release configuration!'
88
94
exit 1
89
95
}
90
- pwsh : ${{ parameters.pwsh }}
96
+ pwsh : true
91
97
92
98
- publish : $(vsixPath)
93
99
artifact : vscode-powershell-vsix-$(System.JobId)
0 commit comments