-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathazure-pipelines-pr.yml
More file actions
152 lines (142 loc) · 5.86 KB
/
azure-pipelines-pr.yml
File metadata and controls
152 lines (142 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
trigger:
batch: true
branches:
include:
- main
- release/*
- internal/release/*
- experimental/*
paths:
exclude:
- Documentation/*
pr:
autoCancel: true
branches:
include:
- main
- release/*
paths:
exclude:
- Documentation/*
variables:
- name: repoName
value: dotnet/wpf
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml@self
parameters:
enablePublishBuildArtifacts: true
enablePublishTestResults: false
enablePublishBuildAssets: false
enablePublishUsingPipelines: false
enableTelemetry: true
helixRepo: $(repoName)
jobs:
- job: Windows_NT
timeoutInMinutes: 120 # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952
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.vs2026preview.scout.amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2026preview.scout.amd64
variables:
- name: _Platform
value: x86
- name: _PlatformArgs
value: /p:Platform=$(_Platform)
- 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: $(repoName)/$(Build.SourceBranch)
- name: _HelixToken
value: ''
- name: _HelixCreator
value: $(repoName)
- name: _programfilesx86
value: ${Env:ProgramFiles(x86)}/dotnet
- name: _programfiles
value: ${Env:ProgramFiles}/dotnet
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
- name: _InternalRuntimeDownloadArgs
value: ''
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: AzureDevOps-Artifact-Feeds-Pats
- group: DotNet-HelixApi-Access
- name: _InternalRuntimeDownloadArgs
value: >-
/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
- name: _HelixSource
value: official/$(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'
strategy:
matrix:
Build_Debug_x86:
_BuildConfig: Debug
Build_Release_x86:
_BuildConfig: Release
Build_Debug_x64:
_BuildConfig: Debug
_Coverage: true
# 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
Build_Debug_arm64:
_BuildConfig: Debug
# override some variables for debug
# _SignType has to be real for package publishing to succeed - do not override to test.
_Platform: arm64
Build_Release_arm64:
_BuildConfig: Release
_Platform: arm64
steps:
# Set VSO Variable(s)
- powershell: eng\pre-build.ps1
displayName: Pre-Build - Set VSO Variables
- template: /eng/common/templates/steps/enable-internal-sources.yml
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
# Use utility script to run script command dependent on agent OS.
- script: eng\scripts\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_PlatformArgs)
$(_InternalRuntimeDownloadArgs)
/p:Coverage=$(_Coverage)
displayName: Windows Build / Publish
- script: eng\scripts\ciunittest.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_PlatformArgs)
$(_InternalRuntimeDownloadArgs)
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\Test.binlog
/p:Coverage=$(_Coverage)
displayName: Run xUnit Tests
condition: eq(variables['_Platform'], 'x64')
- task: PublishTestResults@2
displayName: Publish XUnit Test Results
inputs:
testRunner: VSTest
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/*.trx'
mergeTestResults: true
condition: and(succeededOrFailed(), eq(variables['_BuildConfig'], 'Debug'), eq(variables['_Platform'], 'x64'))
# Upload code coverage data
- script: dotnet msbuild -binaryLogger:artifacts\log\$(_BuildConfig)\uploadCodeCov.binlog;ProjectImports=Embed -restore eng/CodeCoverage.proj
displayName: Upload coverage to codecov.io
condition: and(succeeded(), eq(variables['_Coverage'], True), eq(variables['_BuildConfig'], 'Debug'), eq(variables['_Platform'], 'x64'))