This pull request switches us to the new WinDev scaleset agent pool. It should be faster than the hosted pool, and the larger disks allow us to get rid of our PCH cleanup step.
150 lines
5.6 KiB
YAML
150 lines
5.6 KiB
YAML
parameters:
|
|
additionalBuildArguments: ''
|
|
testLogPath: '$(Build.BinariesDirectory)\$(BuildPlatform)\$(BuildConfiguration)\testsOnBuildMachine.wtl'
|
|
|
|
steps:
|
|
- checkout: self
|
|
submodules: true
|
|
clean: true
|
|
|
|
- task: NuGetToolInstaller@0
|
|
displayName: 'Use NuGet 5.2.0'
|
|
inputs:
|
|
versionSpec: 5.2.0
|
|
|
|
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
|
# This should be `task: NuGetCommand@2`
|
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
|
displayName: Restore NuGet packages for solution
|
|
inputs:
|
|
command: restore
|
|
feedsToUse: config
|
|
configPath: NuGet.config
|
|
restoreSolution: OpenConsole.sln
|
|
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
|
|
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
|
displayName: Restore NuGet packages for extraneous build actions
|
|
inputs:
|
|
command: restore
|
|
feedsToUse: config
|
|
configPath: NuGet.config
|
|
restoreSolution: build/packages.config
|
|
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
|
|
|
- task: VSBuild@1
|
|
displayName: 'Build solution **\OpenConsole.sln'
|
|
inputs:
|
|
solution: '**\OpenConsole.sln'
|
|
vsVersion: 16.0
|
|
platform: '$(BuildPlatform)'
|
|
configuration: '$(BuildConfiguration)'
|
|
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
|
clean: true
|
|
maximumCpuCount: true
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Check MSIX for common regressions'
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
$Package = Get-ChildItem -Recurse -Filter "CascadiaPackage_*.msix"
|
|
.\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path $Package.FullName
|
|
|
|
- task: powershell@2
|
|
displayName: 'Source Index PDBs'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: build\scripts\Index-Pdbs.ps1
|
|
arguments: -SearchDir '$(Build.SourcesDirectory)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
|
errorActionPreference: silentlyContinue
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Rationalize build platform'
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
$Arch = "$(BuildPlatform)"
|
|
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
|
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Run Unit Tests'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: build\scripts\Run-Tests.ps1
|
|
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}'
|
|
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Run Feature Tests (x64 only)'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: build\scripts\Run-Tests.ps1
|
|
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}'
|
|
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x64'))
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Convert Test Logs from WTL to xUnit format'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: build\Helix\ConvertWttLogToXUnit.ps1
|
|
arguments: -WttInputPath '${{ parameters.testLogPath }}' -WttSingleRerunInputPath 'unused.wtl' -WttMultipleRerunInputPath 'unused2.wtl' -XUnitOutputPath 'onBuildMachineResults.xml' -TestNamePrefix '$(BuildConfiguration).$(BuildPlatform)'
|
|
condition: or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86'))
|
|
|
|
- task: PublishTestResults@2
|
|
displayName: 'Upload converted test logs'
|
|
inputs:
|
|
testResultsFormat: 'xUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
|
|
testResultsFiles: '**/onBuildMachineResults.xml'
|
|
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
|
|
#mergeTestResults: false # Optional
|
|
#failTaskOnFailedTests: false # Optional
|
|
testRunTitle: 'On Build Machine Tests' # Optional
|
|
buildPlatform: $(BuildPlatform) # Optional
|
|
buildConfiguration: $(BuildConfiguration) # Optional
|
|
#publishRunAttachments: true # Optional
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy result logs to Artifacts'
|
|
inputs:
|
|
Contents: |
|
|
**/*.wtl
|
|
**/*onBuildMachineResults.xml
|
|
${{ parameters.testLogPath }}
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy *.appx/*.msix to Artifacts (Non-PR builds only)'
|
|
inputs:
|
|
Contents: |
|
|
**/*.appx
|
|
**/*.msix
|
|
**/*.appxsym
|
|
!**/Microsoft.VCLibs*.appx
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/appx'
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy outputs needed for test runs to Artifacts'
|
|
inputs:
|
|
Contents: |
|
|
$(Build.SourcesDirectory)/bin/$(BuildPlatform)/$(BuildConfiguration)/*.exe
|
|
$(Build.SourcesDirectory)/bin/$(BuildPlatform)/$(BuildConfiguration)/*.dll
|
|
$(Build.SourcesDirectory)/bin/$(BuildPlatform)/$(BuildConfiguration)/*.xml
|
|
**/Microsoft.VCLibs.*.appx
|
|
**/TestHostApp/*
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
|
OverWrite: true
|
|
flattenFolders: true
|
|
condition: and(and(succeeded(), eq(variables['BuildPlatform'], 'x64')), ne(variables['Build.Reason'], 'PullRequest'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish All Build Artifacts'
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: 'drop' |