1
+ # TODO: Need to update build documentation.
1
2
parameters :
2
3
name : ' '
3
4
architecture : x64
21
22
timeoutInMinutes : 120
22
23
cancelTimeoutInMinutes : 10
23
24
variables :
24
- dotnetPath : $(Build.SourcesDirectory)/Tools/dotnetcli /dotnet
25
+ dotnetPath : $(Build.SourcesDirectory)/.dotnet /dotnet
25
26
nugetFeed : https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json
26
27
nightlyBuildProjPath : $(Build.SourcesDirectory)/test/Microsoft.ML.NightlyBuild.Tests/Microsoft.ML.NightlyBuild.Tests.csproj
27
28
nightlyBuildRunPath : $(Build.SourcesDirectory)/bin/AnyCPU.$(_configuration)/Microsoft.ML.NightlyBuild.Tests/$(_targetFramework)
43
44
_targetFramework : netcoreapp2.1
44
45
${{ if ne(parameters.customMatrixes, '') }} :
45
46
${{ insert }} : ${{ parameters.customMatrixes }}
46
-
47
+
47
48
pool : ${{ parameters.pool }}
48
49
${{ if ne(parameters.container, '') }} :
49
50
container : ${{ parameters.container }}
63
64
- ${{ if and( eq(parameters.nightlyBuild, 'true'), eq(parameters.pool.name, 'Hosted Ubuntu 1604')) }} :
64
65
- bash : echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$(nightlyBuildRunPath):$LD_LIBRARY_PATH"
65
66
displayName : Set LD_LIBRARY_PATH for Ubuntu and CentOS to locate Native shared library in current running path
66
- - script : ${{ parameters.buildScript }} -$(_configuration) -buildArch =${{ parameters.architecture }}
67
+ - script : ${{ parameters.buildScript }} -configuration $(_configuration) /p:TargetArchitecture =${{ parameters.architecture }}
67
68
displayName : Build
68
69
- ${{ if eq(parameters.pool.name, 'Hosted macOS') }} :
69
70
- task : Bash@3
@@ -78,11 +79,12 @@ jobs:
78
79
script : cd packages;find . -type d -path "*/runtimes/osx-*" -exec rm -rv {} +;find . -type d -path "*/runtimes/win-*" -exec rm -rv {} +;cd ..
79
80
displayName : Clean up non-Linux runtime folders of NuGet Packages to save disk space
80
81
- ${{ if eq(parameters.buildScript, 'build.cmd') }} :
81
- - task : PowerShell@2
82
- inputs :
83
- targetType : inline
84
- script : Get-ChildItem -Path '.\packages\*\runtimes\*' -Recurse | Select -ExpandProperty FullName | Where {$_ -notlike '*\win-*'} | sort length -Descending | Remove-Item -Recurse -Confirm:$false -Force
85
- displayName : Clean up non-Windows runtime folders of NuGet Packages to save disk space
82
+ # TODO: We need to do this. THe packages are restored in a different folder so we need find the correct path.
83
+ # - task: PowerShell@2
84
+ # inputs:
85
+ # targetType: inline
86
+ # script: Get-ChildItem -Path '.\packages\*\runtimes\*' -Recurse | Select -ExpandProperty FullName | Where {$_ -notlike '*\win-*'} | sort length -Descending | Remove-Item -Recurse -Confirm:$false -Force
87
+ # displayName: Clean up non-Windows runtime folders of NuGet Packages to save disk space
86
88
- script : dir /s "bin"
87
89
displayName : show bin folder disk usage
88
90
- ${{ if eq(parameters.nightlyBuild, 'true') }} :
@@ -97,27 +99,22 @@ jobs:
97
99
Get-ChildItem -Path '.\bin\AnyCPU.*' -Recurse |
98
100
Select -ExpandProperty FullName |
99
101
Where {$_ -notlike '*\Microsoft.ML.NightlyBuild.Tests*'} |
100
- sort length -Descending |
101
- Remove-Item -force
102
+ sort length -Descending |
103
+ Remove-Item -force
102
104
Write-Output "Done cleaning up usless project..."
103
105
displayName: Clean up useless project
104
- - script : $(dotnetPath) msbuild -restore $(nightlyBuildProjPath) /p:ReferenceTypeForTestFramework="Nuget" /p:Configuration= $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }}
106
+ - script : $(dotnetPath) msbuild -restore $(nightlyBuildProjPath) /p:ReferenceTypeForTestFramework="Nuget" -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }}
105
107
displayName : Build Nightly-Build Project with latest package versions
106
108
- script : ${{ parameters.buildScript }} -$(_configuration) -runnightlybuildtests
107
109
displayName : Run Nightly Build Tests
108
110
- ${{ if eq(parameters.nightlyBuild, 'false') }} :
109
- - script : ${{ parameters.buildScript }} -- /t:DownloadExternalTestFiles /p:IncludeBenchmarkData=$(_includeBenchmarkData)
110
- displayName : Download Benchmark Data
111
- timeoutInMinutes : 10
112
- - script : ${{ parameters.buildScript }} -- /t:DownloadTensorflowMetaFiles /p:IncludeTensorflowMetaFile=true
113
- displayName : Download Tensorflow Meta File
114
- timeoutInMinutes : 20
115
111
- ${{ if eq(parameters.innerLoop, 'false') }} :
116
112
- ${{ if and(eq(parameters.runSpecific, 'false'), eq(parameters.useVSTestTask, 'false')) }} :
117
- - script : ${{ parameters.buildScript }} -$(_configuration) -runtests -coverage=${{ parameters.codeCoverage }}
113
+ # TODO: Code coverage needs to be fixed.
114
+ - script : ${{ parameters.buildScript }} -configuration $(_configuration) -test -ci /p:TestRunnerAdditionalArguments=-notrait%20Category=SkipInCI # -coverage=${{ parameters.codeCoverage }}
118
115
displayName : Run All Tests.
119
116
- ${{ if and(eq(parameters.runSpecific, 'true'), eq(parameters.useVSTestTask, 'false')) }} :
120
- - script : ${{ parameters.buildScript }} -$(_configuration) -runSpecificTests -coverage=${{ parameters.codeCoverage }}
117
+ - script : ${{ parameters.buildScript }} -configuration $(_configuration) -ci /p:TestRunnerAdditionalArguments=-trait%20Category=RunSpecificTest # -coverage=${{ parameters.codeCoverage }}
121
118
displayName : Run Specific Tests.
122
119
- ${{ if and(eq(parameters.buildScript, 'build.cmd'), eq(parameters.useVSTestTask, 'true')) }} :
123
120
- task : VSTest@2
@@ -127,10 +124,10 @@ jobs:
127
124
testAssemblyVer2 : |
128
125
**\*test.dll
129
126
**\*tests.dll
130
- !**\obj\**
127
+ !**\obj\**
131
128
runSettingsFile : $(Build.SourcesDirectory)/tools-local/vstest.runsettings
132
129
searchFolder : ' $(System.DefaultWorkingDirectory)'
133
- vstestLocationMethod : ' version'
130
+ vstestLocationMethod : ' version'
134
131
vsTestVersion : ' latest'
135
132
runInParallel : False
136
133
runTestsInIsolation : True
@@ -141,17 +138,17 @@ jobs:
141
138
collectDumpOn : onAbortOnly
142
139
publishRunAttachments : true
143
140
- ${{ if eq(parameters.innerLoop, 'true') }} :
144
- - script : ${{ parameters.buildScript }} -$(_configuration) -runCITests -coverage=${{ parameters.codeCoverage }}
141
+ - script : ${{ parameters.buildScript }} -configuration $(_configuration) -test -ci /p:TestRunnerAdditionalArguments=-notrait%20Category=SkipInCI # -coverage=${{ parameters.codeCoverage }}
145
142
displayName : Run CI Tests.
146
- - script : $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet msbuild -restore build/Codecoverage.proj
143
+ - script : $(dotnetPath) msbuild -restore build/Codecoverage.proj
147
144
displayName : Upload coverage to codecov.io
148
145
condition : and(succeeded(), eq(${{ parameters.codeCoverage }}, True))
149
146
- task : PublishTestResults@2
150
147
displayName : Publish Test Results
151
148
condition : succeededOrFailed()
152
149
inputs :
153
150
testRunner : ' vSTest'
154
- searchFolder : ' $(System.DefaultWorkingDirectory)/bin '
151
+ searchFolder : ' $(System.DefaultWorkingDirectory)/artifacts/TestResults '
155
152
testResultsFiles : ' **/*.trx'
156
153
testRunTitle : Machinelearning_Tests_${{ parameters.name }}_$(_configuration)_$(Build.BuildNumber)
157
154
configuration : $(_configuration)
@@ -160,17 +157,16 @@ jobs:
160
157
displayName : Stage build logs
161
158
condition : not(succeeded())
162
159
inputs :
163
- sourceFolder : $(Build.SourcesDirectory)
164
- contents : ' ?(msbuild.*|binclash.log|init-tools.log) '
165
- targetFolder : $(Build.ArtifactStagingDirectory)
160
+ sourceFolder : $(Build.SourcesDirectory)/artifacts/log/
161
+ contents : ' ** '
162
+ targetFolder : $(Build.ArtifactStagingDirectory)artifacts/log/
166
163
- task : CopyFiles@2
167
164
displayName : Stage test output
168
165
condition : not(succeeded())
169
166
inputs :
170
- sourceFolder : $(Build.SourcesDirectory)/bin
167
+ sourceFolder : $(Build.SourcesDirectory)/artifacts/TestResults
171
168
contents : |
172
- **/TestOutput/**/*
173
- **/*.trx
169
+ **
174
170
targetFolder : $(Build.ArtifactStagingDirectory)
175
171
- task : CopyFiles@2
176
172
displayName : Stage process dump and pdb if any
@@ -180,7 +176,7 @@ jobs:
180
176
contents : |
181
177
*.dmp
182
178
CrashDumps/*.dmp
183
- bin/**/*.pdb
179
+ artifacts/ bin/**/*.pdb
184
180
targetFolder : $(Build.ArtifactStagingDirectory)
185
181
- task : PublishBuildArtifacts@1
186
182
displayName : Publish build and test logs
@@ -190,5 +186,5 @@ jobs:
190
186
artifactName : ${{ parameters.name }} $(_config_short)
191
187
artifactType : container
192
188
- ${{ if eq(parameters.nightlyBuild, 'false') }} :
193
- - script : ${{ parameters.buildScript }} -buildPackages
189
+ - script : ${{ parameters.buildScript }} -pack -ci
194
190
displayName : Build Packages
0 commit comments