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