forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstage-helix-tests.yml
More file actions
155 lines (144 loc) · 5.4 KB
/
Copy pathstage-helix-tests.yml
File metadata and controls
155 lines (144 loc) · 5.4 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
153
154
155
# Template for running tests on Helix on dnceng
parameters:
- name: prepareSteps
type: stepList
default: []
- name: postSteps
type: stepList
default: []
- name: enableSourceBuild
type: boolean
default: false
- name: enableSourceIndex
type: boolean
default: false
- name: sourceIndexParams
type: object
default: []
- name: publishAssets
type: boolean
default: false
- name: enableMicrobuild
type: boolean
default: false
- name: runAsPublic
type: boolean
default: true
- name: helixInternal
type: string
default: ''
- name: HelixAccessToken
type: string
default: ''
- name: creator
type: string
default: 'maui'
- name: extraHelixArguments
type: string
default: ''
- name: buildTaskProjects
type: string
default: '$(Build.SourcesDirectory)/Microsoft.Maui.BuildTasks.slnf'
- name: helixProject
type: string
default: '$(Build.SourcesDirectory)/eng/helix.proj'
- name: buildConfigurations
type: object
default:
- Debug
- Release
- name: helixPool
type: object
stages:
- stage: HelixTests
displayName: Run Helix Unit Tests
dependsOn: []
jobs:
- ${{ each BuildConfiguration in parameters.buildConfigurations }}:
- template: ${{ iif(eq(parameters.runAsPublic, 'true'), '/eng/common/templates/jobs/jobs.yml@self', '/eng/common/templates-official/jobs/jobs.yml@self') }}
parameters:
helixRepo: dotnet/maui
pool: ${{ parameters.helixPool }}
enableMicrobuild: ${{ parameters.enableMicrobuild }}
enablePublishUsingPipelines: true
enablePublishBuildAssets: ${{ parameters.publishAssets }}
enableTelemetry: true
enableSourceBuild: ${{ parameters.enableSourceBuild }}
enableSourceIndex: ${{ parameters.enableSourceIndex }}
sourceIndexParams: ${{ parameters.sourceIndexParams }}
publishAssetsImmediately: true
enablePublishBuildArtifacts: true
enablePublishTestResults: false
workspace:
clean: all
jobs:
- job: test_helix_unit_tests_windows_${{ BuildConfiguration }}
displayName: Windows Helix Unit Tests (${{ BuildConfiguration }})
timeoutInMinutes: 240
variables:
- name: _BuildConfig
value: ${{ BuildConfiguration }}
steps:
- ${{ each step in parameters.prepareSteps }}:
- ${{ each pair in step }}:
${{ pair.key }}: ${{ pair.value }}
- script: dotnet cake --target=dotnet-buildtasks --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 🛠️ Provision SDK & Build BuildTasks
retryCountOnTaskFailure: 3
env:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
- script: $(_msbuildCommand) "${{ parameters.helixProject }}" -warnAsError 0 -restore /p:Configuration=${{ BuildConfiguration }} /p:EnableHelixJobMonitor=true /p:HelixInternal="${{ parameters.helixInternal }}" /p:TestRunNameSuffix="_${{ BuildConfiguration }}" /p:SkipInitInternalTooling=true /bl:$(Build.Arcade.LogsPath)${{ BuildConfiguration }}/helix_tests.binlog ${{ parameters.extraHelixArguments }}
displayName: Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: ${{ parameters.HelixAccessToken }}
- job: HelixJobMonitor
displayName: Monitor Helix Jobs
timeoutInMinutes: 360
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals build.azurelinux.3.amd64.open
${{ else }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals build.azurelinux.3.amd64
steps:
- checkout: self
fetchDepth: 1
- bash: |
set -euo pipefail
toolPath="$AGENT_TEMPDIRECTORY/helix-job-monitor"
bash ./eng/common/dotnet.sh
toolVersion=$(bash ./eng/common/dotnet.sh msbuild eng/Versions.props -getProperty:MicrosoftDotNetHelixSdkPackageVersion -nologo | tail -n 1)
if [[ -z "$toolVersion" || "$toolVersion" =~ [[:space:]] ]]; then
echo "Could not read the Helix SDK package version from eng/Versions.props." >&2
exit 1
fi
bash ./eng/common/dotnet.sh tool install \
--tool-path "$toolPath" \
Microsoft.DotNet.Helix.JobMonitor \
--version "$toolVersion"
toolDll=$(find "$toolPath/.store" -path '*/tools/*/any/Microsoft.DotNet.Helix.JobMonitor.dll' -type f -print -quit)
if [ ! -f "$toolDll" ]; then
echo "Could not find the Helix Job Monitor DLL in '$toolPath/.store'." >&2
exit 1
fi
echo "##vso[task.setvariable variable=HelixJobMonitorDll]$toolDll"
displayName: Install Helix Job Monitor
- bash: |
set -euo pipefail
bash ./eng/common/dotnet.sh exec "$(HelixJobMonitorDll)" \
--helix-base-uri 'https://helix.dot.net/' \
--polling-interval-seconds 30 \
--fail-on-failed-tests true \
--max-wait-minutes 355 \
--stage-name '$(System.StageName)' \
--organization dotnet \
--repository maui \
--build-reason '$(Build.Reason)' \
--source-branch '$(Build.SourceBranch)'
displayName: Monitor Helix Jobs
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HELIX_ACCESSTOKEN: ${{ parameters.HelixAccessToken }}