Skip to content

Commit d945e84

Browse files
Merge pull request #1933 from PowerShell/andschwa/fix-release-build
Add assertion to build that bits are built in release configuration and invoke tests in release configuration. Resolves PowerShell/vscode-powershell#4218 by (correctly and how it was expected in the first place) preventing the developer option to wait for debugger to be in the binary.
2 parents 9416a8a + 5d64238 commit d945e84

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

+13-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ steps:
3535
displayName: Test
3636
inputs:
3737
targetType: inline
38-
script: Invoke-Build Test
38+
script: Invoke-Build Test -Configuration Release
3939
pwsh: ${{ parameters.pwsh }}
4040

4141
- task: PublishTestResults@2
@@ -45,6 +45,18 @@ steps:
4545
testResultsFiles: '**/*.trx'
4646
condition: succeededOrFailed()
4747

48+
- task: PowerShell@2
49+
displayName: Assert PowerShellEditorServices release configuration
50+
inputs:
51+
targetType: inline
52+
script: |
53+
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/module/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll")
54+
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
55+
Write-Host "##vso[task.LogIssue type=error;] PowerShell Editor Services bits were not built in release configuration!"
56+
exit 1
57+
}
58+
pwsh: ${{ parameters.pwsh }}
59+
4860
# NOTE: We zip the artifacts because they're ~20 MB compressed, but ~300 MB raw,
4961
# and we have limited pipeline artifact storage space.
5062
- task: ArchiveFiles@2

0 commit comments

Comments
 (0)