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