2023-01-10 09:23:30 +03:00
#
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
#
#
parameters :
# Needed because runAsPublic is used in template expressions, which can't read from user-defined variables
# Defaults to true
2023-01-12 11:54:23 +03:00
runAsPublic : false
2023-01-10 09:23:30 +03:00
repoName : dotnet/wpf
jobs :
- template : /eng/common/templates/jobs/jobs.yml
parameters :
enableMicrobuild : true
enablePublishBuildArtifacts : true
enablePublishTestResults : false # tests run in helix
enablePublishBuildAssets : true
enablePublishUsingPipelines : true
enableTelemetry : true
enableSourceIndex : true
sourceIndexParams :
condition : eq(variables['Build.SourceBranch'], 'refs/heads/main')
binlogPath : artifacts/log/Debug/x86/Build.binlog
pool :
${{ if eq(variables['System.TeamProject'], 'public') }}:
name : NetCore-Public
demands : ImageOverride -equals windows.vs2022preview.amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name : NetCore1ESPool-Internal
demands : ImageOverride -equals windows.vs2022preview.amd64
helixRepo : $(repoName)
jobs :
- job : Windows_NT
2023-01-12 11:54:23 +03:00
timeoutInMinutes : 180 # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952
2023-01-10 09:23:30 +03:00
pool :
# For public jobs, use the hosted pool. For internal jobs use the internal pool.
# Will eventually change this to two BYOC pools.
# agent pool can't be read from a user-defined variable (Azure DevOps limitation)
${{ if eq(variables['System.TeamProject'], 'public') }}:
name : NetCore-Public
demands : ImageOverride -equals windows.vs2022preview.amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name : NetCore1ESPool-Internal
demands : ImageOverride -equals windows.vs2022preview.amd64
variables :
# needed for signing
- name : _TeamName
value : DotNetCore
- name : _SignType
value : test
- name : _SignArgs
value : ''
- name : _PublishArgs
value : ''
- name : _OfficialBuildIdArgs
value : ''
- name : _Platform
value : x86
- name : _PlatformArgs
value : /p:Platform=$(_Platform)
- name : _PublicBuildPipeline # We will run Helix tests when building in the open, but do not repeat when building and publishing again using the internal build-pipeline
value : true
- name : _TestHelixAgentPool
value : 'Windows.10.Amd64.ClientRS5.Open' # Preferred:'Windows.10.Amd64.Open%3bWindows.7.Amd64.Open%3bWindows.10.Amd64.ClientRS5.Open'; See https://github.com/dotnet/wpf/issues/952
- name : _HelixStagingDir
value : $(BUILD.STAGINGDIRECTORY)\helix\functests
- name : _HelixSource
value : ${{ parameters.repoName }}/$(Build.SourceBranch)
- name : _HelixToken
value : ''
- name : _HelixCreator
value : ${{ parameters.repoName }}
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
- name : _InternalRuntimeDownloadArgs
value : ''
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group : DotNetBuilds storage account read tokens
- group : AzureDevOps-Artifact-Feeds-Pats
- name : _InternalRuntimeDownloadArgs
value : >-
/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
# Override some values if we're building internally
- ${{ if eq(parameters.runAsPublic, 'false') }}:
# note: You have to use list syntax here (- name: value) or you will get errors about declaring the same variable multiple times
- name : _SignType
value : test
- group : DotNet-HelixApi-Access
# note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved
# until the agent is running on the machine. They can be overridden any time before they are resolved,
# like in the job matrix below (see Build_Debug)
- name : _SignArgs
value : /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
- name : _PublishArgs
value : /p:DotNetPublishUsingPipelines=true
- name : _OfficialBuildIdArgs
value : /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
- name : _PublicBuildPipeline
value : false
- name : _HelixSource
value : official/${{ parameters.repoName }}/$(Build.SourceBranch)
- name : _HelixToken
value : '$(HelixApiAccessToken)' # from DotNet-HelixApi-Access group
- name : _HelixCreator
value : '' #if _HelixToken is set, Creator must be empty
- name : _TestHelixAgentPool
value: 'Windows.10.Amd64.ClientRS5' # Preferred : 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5'
2023-02-08 08:17:11 +03:00
- name : _programfilesx86
value : ${Env:ProgramFiles(x86)}/dotnet
- name : _programfiles
value : ${Env:ProgramFiles}/dotnet
2023-01-10 09:23:30 +03:00
strategy :
matrix :
${{ if eq(parameters.runAsPublic, 'true') }}:
Build_Debug_x86 :
_BuildConfig : Debug
# override some variables for debug
# _SignType has to be real for package publishing to succeed - do not override to test.
Build_Release_x86 :
_BuildConfig : Release
${{ if eq(parameters.runAsPublic, 'true') }}:
Build_Debug_x64 :
_BuildConfig : Debug
# override some variables for debug
# _SignType has to be real for package publishing to succeed - do not override to test.
_Platform : x64
Build_Release_x64 :
_BuildConfig : Release
_Platform : x64
2023-01-12 11:54:23 +03:00
2023-01-10 09:23:30 +03:00
steps :
- checkout : self
clean : true
# Set VSO Variable(s)
- powershell : eng\pre-build.ps1
displayName : Pre-Build - Set VSO Variables
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- task : PowerShell@2
displayName : Setup Private Feeds Credentials
inputs :
filePath : $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments : -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env :
Token : $(dn-bot-dnceng-artifact-feeds-rw)
# Use utility script to run script command dependent on agent OS.
- script : eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_PublishArgs)
$(_SignArgs)
$(_OfficialBuildIdArgs)
$(_PlatformArgs)
$(_InternalRuntimeDownloadArgs)
displayName : Windows Build / Publish
# This condition should be kept in sync with the condition for 'Run DRTs' step
# When building on a regular pipeline (!_HelixPipeline), build as usual
# When building on a Helix pipeline, only build Release configs
# (!_HelixPipeline) ||
# (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release)
condition : or(ne(variables['_HelixPipeline'], 'true'), and(eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true')))
- task : DownloadPipelineArtifact@2
inputs :
buildType : 'specific'
2023-01-12 11:54:23 +03:00
project : '7ea9116e-9fac-403d-b258-b31fcf1bb293'
definition : '479'
2023-01-30 07:43:18 +03:00
buildVersionToDownload : latestFromBranch
branchName : refs/heads/master
2023-01-10 09:23:30 +03:00
checkDownloadedFiles : true
artifactName : Tests.$(_BuildConfig).$(_Platform).zip
2023-01-12 11:54:23 +03:00
downloadPath : '$(System.ArtifactsDirectory)\testbinzip\'
2023-01-10 09:23:30 +03:00
- task : ExtractFiles@1
displayName : Extract Test Bins
inputs :
archiveFilePatterns : '$(System.ArtifactsDirectory)\testbinzip\*.zip'
destinationFolder : '$(System.ArtifactsDirectory)\testbins'
cleanDestinationFolder : true
overwriteExistingFiles : true
2023-01-12 11:54:23 +03:00
2023-02-08 08:17:11 +03:00
- task : PowerShell@2
displayName : Install .NET Core
inputs :
filePath : $(Build.SourcesDirectory)/eng/common/dotnet-test-install.ps1
arguments : -InstallDir $(_programfiles) -Architecture $(_Platform) -Runtime dotnet -Version 8.0.0-alpha.1.23080.2
condition : eq(variables['_Platform'], 'x64')
- task : PowerShell@2
displayName : Install .NET Core(x86)
inputs :
filePath : $(Build.SourcesDirectory)/eng/common/dotnet-test-install.ps1
arguments : -InstallDir $(_programfilesx86) -Architecture $(_Platform) -Runtime dotnet -Version 8.0.0-alpha.1.23080.2
condition : eq(variables['_Platform'], 'x86')
- task : PowerShell@2
displayName : Install .NET WindowsDesktop
inputs :
filePath : $(Build.SourcesDirectory)/eng/common/dotnet-test-install.ps1
arguments : -InstallDir $(_programfiles) -Architecture $(_Platform) -Runtime windowsdesktop -Version 8.0.0-alpha.1.23080.2
condition : eq(variables['_Platform'], 'x64')
2023-01-12 11:54:23 +03:00
- task : PowerShell@2
2023-02-08 08:17:11 +03:00
displayName : Install .NET WindowsDesktop(x86)
inputs :
filePath : $(Build.SourcesDirectory)/eng/common/dotnet-test-install.ps1
arguments : -InstallDir $(_programfilesx86) -Architecture $(_Platform) -Runtime windowsdesktop -Version 8.0.0-alpha.1.23080.2
condition : eq(variables['_Platform'], 'x86')
- task : PowerShell@2
displayName : Replace WPF binaries
2023-01-31 10:34:14 +03:00
inputs :
targetType : 'inline'
2023-02-08 08:17:11 +03:00
script : '.\eng\copy-wpf.ps1 -testhost -destination $(_programfilesx86) -$(_BuildConfig) -arch $(_Platform)'
condition : eq(variables['_Platform'], 'x86')
2023-01-31 13:12:37 +03:00
- task : PowerShell@2
2023-02-08 08:17:11 +03:00
displayName : Replace WPF binaries
2023-01-31 13:12:37 +03:00
inputs :
targetType : 'inline'
2023-02-08 08:17:11 +03:00
script : '.\eng\copy-wpf.ps1 -testhost -destination $(_programfiles) -$(_BuildConfig) -arch $(_Platform)'
condition : eq(variables['_Platform'], 'x64')
2023-01-31 10:34:14 +03:00
- task : PowerShell@2
displayName : Run DRTs
2023-01-12 11:54:23 +03:00
inputs :
targetType : 'inline'
script : '.\RunDrts.cmd'
workingDirectory : '$(System.ArtifactsDirectory)\testbins'
continueOnError : true
2023-01-10 09:23:30 +03:00
- task : PowerShell@2
2023-01-31 10:34:14 +03:00
displayName : Run Microsuites
2023-01-10 09:23:30 +03:00
inputs :
targetType : 'inline'
2023-01-12 11:54:23 +03:00
script : '.\RunTests.cmd /Keywords=Microsuite'
2023-01-10 09:23:30 +03:00
workingDirectory : '$(System.ArtifactsDirectory)\testbins'
2023-01-12 11:54:23 +03:00
continueOnError : true
2023-02-16 11:25:14 +03:00
- task : PowerShell@2
displayName : Run Feature Suites
inputs :
targetType : 'inline'
script : '.\RunTests.cmd /Area=$(areas)'
workingDirectory : '$(System.ArtifactsDirectory)\testbins'
continueOnError : true
condition : ne(variables['areas'], '')
- task : PowerShell@2
displayName : Run Full Suites
inputs :
targetType : 'inline'
script : '.\RunTests.cmd'
workingDirectory : '$(System.ArtifactsDirectory)\testbins'
continueOnError : true
condition : eq(variables['fulltest'], 'fulltest')
- task : CopyFiles@2
inputs :
SourceFolder : 'C:\Users\cloudtest\AppData\Roaming\QualityVault\Run\Report\'
Contents : '**'
TargetFolder : '$(System.DefaultWorkingDirectory)\Results\'
CleanTargetFolder : true
OverWrite : true
condition : eq(variables['_Platform'], 'x64')
- task : CopyFiles@2
inputs :
SourceFolder : 'C:\Users\cloudtest\AppData\Roaming\QualityVault\Run\Report\'
Contents : '**'
TargetFolder : '$(System.DefaultWorkingDirectory)\ResultsX86\'
CleanTargetFolder : true
OverWrite : true
condition : eq(variables['_Platform'], 'x86')
- task : PublishPipelineArtifact@1
inputs :
artifactName : 'TestResultsX64'
targetPath : '$(System.DefaultWorkingDirectory)\Results\'
condition : eq(variables['_Platform'], 'x64')
- task : PublishPipelineArtifact@1
inputs :
artifactName : 'TestResultsX86'
targetPath : '$(System.DefaultWorkingDirectory)\ResultsX86\'
condition : eq(variables['_Platform'], 'x86')
- task : PublishTestResults@2
inputs :
testResultsFormat : 'XUnit'
testResultsFiles : 'testResults.xml'
searchFolder : '$(System.DefaultWorkingDirectory)\Results\'
testRunTitle : 'CTP results'