forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.opt-prof.yml
96 lines (92 loc) · 3.78 KB
/
.opt-prof.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
# Runs OptProf for MSBuild binaries based on an insertion build
trigger: none # Prevents this pipeline from triggering on check-ins
pr: none # don't run this on PR as well, this should only trigger off on MSBuild runs
schedules:
- cron: "0 9 * * Wed,Sat"
displayName: Weekly OptProf Run
branches:
include:
- main
always: true
resources:
pipelines:
- pipeline: ComponentBuildUnderTest
source: MSBuild\MSBuild # The name of the pipeline that produces the artifact
trigger:
branches:
- vs*
- pipeline: DartLab
project: DevDiv
source: DartLab
branch: main
- pipeline: DartLab.OptProf
source: DartLab.OptProf
branch: main
tags:
- production
repositories:
- repository: DartLabTemplates
type: git
name: DartLab.Templates
- repository: DartLabOptProfTemplates
type: git
name: DartLab.OptProf
ref: refs/tags/Production
parameters:
# Whether or not to delete the test machines after the run completes
- name: testMachineCleanUpStrategy
type: string
default: delete
values:
- delete
- stop
stages:
- template: \templates\stages\visual-studio\single-runsettings.yml@DartLabOptProfTemplates
parameters:
##### Required #####
runSettingsURI: $(Pipeline.Workspace)\ComponentBuildUnderTest\VSSetup\Insertion\OptProf\Training.runsettings
visualStudioBootstrapperURI: $(VisualStudio.InstallationUnderTest.BootstrapperURL)
##### Optional #####
name: OptProfProfilingWorkflow
displayName: OptProf Profiling Workflow
optOptimizationInputsDropName: $(OptimizationInputsDropName)
cloudBuildResourceName: ComponentBuildUnderTest
testLabPoolName: VS-Platform # The test lab pool to run your tests in
testMachineCleanUpStrategy: ${{parameters.testMachineCleanUpStrategy}}
testMachineImageName: Windows-11-Enterprise-23H2
visualStudioSigning: Test
variables:
- name: branchName # The branch in the VS repo the bootstrapper was based on
value: $[replace(variables['resources.pipeline.ComponentBuildUnderTest.sourceBranch'],'refs/heads/','')]
- name: OptimizationInputsDropName # The naming convention of the OptimizationInputsDrop
value: OptimizationData/DotNet-msbuild-Trusted/$(branchName)/$(resources.pipeline.ComponentBuildUnderTest.runName)/$(Build.BuildId)/$(System.StageAttempt)
##### Step Hooks #####
preTestMachineConfigurationStepList:
- download: ComponentBuildUnderTest
artifact: MicroBuildOutputs
patterns: '**\BootstrapperInfo.json'
displayName: Download Bootstrapper Information
- download: ComponentBuildUnderTest
artifact: VSSetup
patterns: '**\*.runsettings'
displayName: Download OptProf Information
- powershell: |
try {
$bootstrapperInfoJson = Get-Content -Raw -Path '$(Pipeline.Workspace)\ComponentBuildUnderTest\MicroBuildOutputs\BootstrapperInfo.json' | ConvertFrom-Json
$vsBranch = $bootstrapperInfoJson[0].VSBranch
Write-Host "VSBootstrapperBranch: $vsBranch"
Set-AzurePipelinesVariable 'VSBootstrapperBranch' $vsBranch
}
catch {
Write-Host $_
Write-Error "Failed to set VSBootstrapperBranch pipeline variable"
throw
}
displayName: Set 'VSBootstrapperBranch' variable
- task: PowerShell@2
displayName: Set 'VisualStudio.InstallationUnderTest.BootstrapperURL' variable
inputs:
filePath: $(DartLab.Path)\Scripts\VisualStudio\Bootstrapper\Get-BootstrapperURL.ps1
arguments: -BootstrapperInfoJsonURI '$(Pipeline.Workspace)\ComponentBuildUnderTest\MicroBuildOutputs\BootstrapperInfo.json' -VSBranch '$(VSBootstrapperBranch)' -OutVariableName 'VisualStudio.InstallationUnderTest.BootstrapperURL'
preDeployAndRunTestsStepList:
- download: ComponentBuildUnderTest