-
Notifications
You must be signed in to change notification settings - Fork 526
/
azure-pipelines-CI.yml
184 lines (175 loc) · 7.2 KB
/
azure-pipelines-CI.yml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# azure-pipelines-CI.yml
parameters:
- name: SkipTests
displayName: Skip Tests
type: boolean
default: false
# CI and PR triggers
trigger:
- main
- feature/*
- release/*
pr:
- main
- feature/*
- release/*
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
variables:
- template: /eng/common/templates/variables/pool-providers.yml@self
- template: /eng/templates/variables-template.yml@self
- name: additionalWindowsArgs
value: ''
- name: additionalLinuxArgs
value: ''
extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
# Update the pool with your team's 1ES hosted pool.
pool:
name: $(DncEngInternalBuildPool) # Name of your hosted pool
image: 1es-windows-2022 # Name of the image in your pool. If not specified, first image of the pool is used
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS
# Build Tags
customBuildTags:
- TryDotNet
- $(Build.BuildNumber)
sdl:
git:
longpaths: true
tsa:
enabled: true
config:
repositoryName: 'dotnet-try'
codebaseName: 'dotnet-try'
instanceUrl: 'https://devdiv.visualstudio.com/'
projectName: 'DEVDIV'
iterationPath: 'DevDiv\\Future Backlog'
areaPath: 'DevDiv\\NET Developer Experience\\VS Testing\\Interactive'
notificationAliases: ['[email protected]']
serviceTreeID: 'ab4d58de-beb3-4714-866c-1b46a48ea002'
allTools: true
policheck:
enabled: true
stages:
- stage: build
displayName: Build and Test
jobs:
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
jobs:
- job: Windows_NT
pool:
# TODO: Can we use latest or equivalent?
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals 1es-windows-2022
os: windows
templateContext:
# This enables SDL scanning to be run once across all artifacts
outputParentDirectory: $(Build.SourcesDirectory)/artifacts
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts
artifactName: Windows_artifacts
displayName: Publish Windows artifacts
condition: always()
variables:
- name: TRYDOTNET_PREBUILDS_PATH
value: $(Build.SourcesDirectory)\artifacts\trydotnet-prebuilds
- name: POCKETLOGGER_LOG_PATH
value: $(Build.SourcesDirectory)\artifacts\logs\pocketlogger.log
- name: RunIntegrationTests
value: true
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Symbol-Server-Pats
- name: _SignType
value: Real
- name: _DotNetPublishToBlobFeed
value: false
- name: _BuildArgs
value: /p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/p:MicroBuild_SigningEnabled=true
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:DotNetPublishToBlobFeed=false
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- template: /eng/templates/build-and-test-job-windows-templates.yml@self
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
buildArgs: $(_BuildArgs)
additionalArgs: $(additionalWindowsArgs)
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: false
enablePublishUsingPipelines: false
jobs:
- job: Linux
pool:
name: $(DncEngInternalBuildPool)
os: linux
demands: ImageOverride -equals 1es-mariner-2
templateContext:
# This enables SDL scanning to be run once across all artifacts
outputParentDirectory: $(Build.SourcesDirectory)/artifacts
outputs:
- output: pipelineArtifact
targetPath: $(Build.SourcesDirectory)/artifacts
artifactName: Linux_artifacts
displayName: Publish Linux artifacts
condition: always()
variables:
- name: TRYDOTNET_PREBUILDS_PATH
value: $(Build.SourcesDirectory)/artifacts/trydotnet-prebuilds
- name: POCKETLOGGER_LOG_PATH
value: $(Build.SourcesDirectory)/artifacts/logs/pocketlogger.log
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- template: /eng/templates/build-and-test-job-linux-templates.yml@self
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
additionalArgs: $(additionalLinuxArgs)