1+ #
2+ # This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
3+ #
4+ #
5+
6+ parameters :
7+ # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables
8+ # Defaults to true
9+ runAsPublic : true
10+ repoName : dotnet/wpf
11+
12+ jobs :
13+ - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }} :
14+ - template : /eng/common/templates/job/onelocbuild.yml
15+ parameters :
16+ MirrorRepo : wpf
17+ LclSource : lclFilesfromPackage
18+ LclPackageId : ' LCL-JUNO-PROD-WPF'
19+ - template : /eng/common/templates/jobs/jobs.yml
20+ parameters :
21+ enableMicrobuild : true
22+ enablePublishBuildArtifacts : true
23+ enablePublishTestResults : false # tests run in helix
24+ enablePublishBuildAssets : true
25+ enablePublishUsingPipelines : true
26+ enableTelemetry : true
27+ enableSourceIndex : true
28+ sourceIndexParams :
29+ condition : eq(variables['Build.SourceBranch'], 'refs/heads/main')
30+ binlogPath : artifacts/log/Debug/x86/Build.binlog
31+ pool :
32+ ${{ if eq(variables['System.TeamProject'], 'public') }} :
33+ name : NetCore-Public
34+ demands : ImageOverride -equals windows.vs2022preview.amd64.Open
35+ ${{ if eq(variables['System.TeamProject'], 'internal') }} :
36+ name : NetCore1ESPool-Internal
37+ demands : ImageOverride -equals windows.vs2022preview.amd64
38+ helixRepo : $(repoName)
39+
40+ jobs :
41+ - job : Windows_NT
42+ timeoutInMinutes : 120 # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952
43+ pool :
44+ # For public jobs, use the hosted pool. For internal jobs use the internal pool.
45+ # Will eventually change this to two BYOC pools.
46+ # agent pool can't be read from a user-defined variable (Azure DevOps limitation)
47+ ${{ if eq(variables['System.TeamProject'], 'public') }} :
48+ name : NetCore-Public
49+ demands : ImageOverride -equals windows.vs2022preview.amd64.Open
50+ ${{ if eq(variables['System.TeamProject'], 'internal') }} :
51+ name : NetCore1ESPool-Internal
52+ demands : ImageOverride -equals windows.vs2022preview.amd64
53+ variables :
54+ # needed for signing
55+ - name : _TeamName
56+ value : DotNetCore
57+ - name : _SignType
58+ value : real
59+ - name : _SignArgs
60+ value : ' '
61+ - name : _PublishArgs
62+ value : ' '
63+ - name : _OfficialBuildIdArgs
64+ value : ' '
65+ - name : _Platform
66+ value : x86
67+ - name : _PlatformArgs
68+ value : /p:Platform=$(_Platform)
69+ - 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
70+ value : true
71+ - name : _TestHelixAgentPool
72+ 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
73+ - name : _HelixStagingDir
74+ value : $(BUILD.STAGINGDIRECTORY)\helix\functests
75+ - name : _HelixSource
76+ value : ${{ parameters.repoName }}/$(Build.SourceBranch)
77+ - name : _HelixToken
78+ value : ' '
79+ - name : _HelixCreator
80+ value : ${{ parameters.repoName }}
81+ - ${{ if ne(variables['System.TeamProject'], 'internal') }} :
82+ - name : _InternalRuntimeDownloadArgs
83+ value : ' '
84+ - ${{ if eq(variables['System.TeamProject'], 'internal') }} :
85+ - group : DotNetBuilds storage account read tokens
86+ - group : AzureDevOps-Artifact-Feeds-Pats
87+ - name : _InternalRuntimeDownloadArgs
88+ value : >-
89+ /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
90+ /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
91+
92+
93+ # Override some values if we're building internally
94+ - ${{ if eq(parameters.runAsPublic, 'false') }} :
95+ # note: You have to use list syntax here (- name: value) or you will get errors about declaring the same variable multiple times
96+ - name : _SignType
97+ value : real
98+ - group : DotNet-HelixApi-Access
99+
100+ # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved
101+ # until the agent is running on the machine. They can be overridden any time before they are resolved,
102+ # like in the job matrix below (see Build_Debug)
103+ - name : _SignArgs
104+ value : /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
105+ - name : _PublishArgs
106+ value : /p:DotNetPublishUsingPipelines=true
107+ - name : _OfficialBuildIdArgs
108+ value : /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
109+ - name : _PublicBuildPipeline
110+ value : false
111+ - name : _HelixSource
112+ value : official/${{ parameters.repoName }}/$(Build.SourceBranch)
113+ - name : _HelixToken
114+ value : ' $(HelixApiAccessToken)' # from DotNet-HelixApi-Access group
115+ - name : _HelixCreator
116+ value : ' ' # if _HelixToken is set, Creator must be empty
117+ - name : _TestHelixAgentPool
118+ value : ' Windows.10.Amd64.ClientRS5' # Preferred: 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5'
119+
120+ strategy :
121+ matrix :
122+ ${{ if eq(parameters.runAsPublic, 'true') }} :
123+ Build_Debug_x86 :
124+ _BuildConfig : Debug
125+ # override some variables for debug
126+ # _SignType has to be real for package publishing to succeed - do not override to test.
127+ Build_Release_x86 :
128+ _BuildConfig : Release
129+ ${{ if eq(parameters.runAsPublic, 'true') }} :
130+ Build_Debug_x64 :
131+ _BuildConfig : Debug
132+ # override some variables for debug
133+ # _SignType has to be real for package publishing to succeed - do not override to test.
134+ _Platform : x64
135+ Build_Release_x64 :
136+ _BuildConfig : Release
137+ _Platform : x64
138+ ${{ if eq(parameters.runAsPublic, 'true') }} :
139+ Build_Debug_arm64 :
140+ _BuildConfig : Debug
141+ # override some variables for debug
142+ # _SignType has to be real for package publishing to succeed - do not override to test.
143+ _Platform : arm64
144+ Build_Release_arm64 :
145+ _BuildConfig : Release
146+ _Platform : arm64
147+ steps :
148+ - checkout : self
149+ clean : true
150+
151+ # Set VSO Variable(s)
152+ - powershell : eng\pre-build.ps1
153+ displayName : Pre-Build - Set VSO Variables
154+
155+ - ${{ if ne(variables['System.TeamProject'], 'public') }} :
156+ - task : PowerShell@2
157+ displayName : Setup Private Feeds Credentials
158+ inputs :
159+ filePath : $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
160+ arguments : -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
161+ env :
162+ Token : $(dn-bot-dnceng-artifact-feeds-rw)
163+
164+ # Use utility script to run script command dependent on agent OS.
165+ - script : eng\common\cibuild.cmd
166+ -configuration $(_BuildConfig)
167+ -prepareMachine
168+ $(_PublishArgs)
169+ $(_SignArgs)
170+ $(_OfficialBuildIdArgs)
171+ $(_PlatformArgs)
172+ $(_InternalRuntimeDownloadArgs)
173+ displayName : Windows Build / Publish
174+ # This condition should be kept in sync with the condition for 'Run DRTs' step
175+ # When building on a regular pipeline (!_HelixPipeline), build as usual
176+ # When building on a Helix pipeline, only build Release configs
177+ # (!_HelixPipeline) ||
178+ # (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release)
179+ condition : or(ne(variables['_HelixPipeline'], 'true'), and(eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true')))
180+
181+ # Run DRTs
182+ - powershell : eng\common\cibuild.cmd
183+ -configuration $(_BuildConfig)
184+ $(_OfficialBuildIdArgs)
185+ $(_PlatformArgs)
186+ -projects $(Build.SourcesDirectory)\eng\helixpublish.proj
187+ /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\HelixDrt.binlog
188+ displayName : Run Developer Regression Tests on Helix Machine (Release)
189+ env :
190+ HelixSource : $(_HelixSource)
191+ HelixType : ' tests/drt'
192+ HelixBuild : $(Build.BuildNumber)
193+ HelixTargetQueues : $(_TestHelixAgentPool)
194+ HelixAccessToken : $(_HelixToken) # only defined for internal CI
195+ Creator : $(_HelixCreator)
196+ SYSTEM_ACCESSTOKEN : $(System.AccessToken)
197+ # This condition should be kept in sync with the condition for cibuild.cmd step with displayName: "Windows Build / Publish"
198+ # Only run ...
199+ # ...When building on a Helix pipeline, only build Release configs
200+ #
201+ # (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release)
202+ #
203+ condition : and(succeeded(), eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))
0 commit comments