1+ # TODO: Need to update build documentation.
12parameters :
23 name : ' '
34 architecture : x64
2122 timeoutInMinutes : 120
2223 cancelTimeoutInMinutes : 10
2324 variables :
24- dotnetPath : $(Build.SourcesDirectory)/Tools/dotnetcli /dotnet
25+ dotnetPath : $(Build.SourcesDirectory)/.dotnet /dotnet
2526 nugetFeed : https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json
2627 nightlyBuildProjPath : $(Build.SourcesDirectory)/test/Microsoft.ML.NightlyBuild.Tests/Microsoft.ML.NightlyBuild.Tests.csproj
2728 nightlyBuildRunPath : $(Build.SourcesDirectory)/bin/AnyCPU.$(_configuration)/Microsoft.ML.NightlyBuild.Tests/$(_targetFramework)
4344 _targetFramework : netcoreapp2.1
4445 ${{ if ne(parameters.customMatrixes, '') }} :
4546 ${{ insert }} : ${{ parameters.customMatrixes }}
46-
47+
4748 pool : ${{ parameters.pool }}
4849 ${{ if ne(parameters.container, '') }} :
4950 container : ${{ parameters.container }}
5556 - ${{ if and( eq(parameters.nightlyBuild, 'true'), eq(parameters.pool.name, 'Hosted Ubuntu 1604')) }} :
5657 - bash : echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$(nightlyBuildRunPath):$LD_LIBRARY_PATH"
5758 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 }}
5960 displayName : Build
6061 - ${{ if eq(parameters.pool.name, 'Hosted macOS') }} :
6162 - task : Bash@3
@@ -70,11 +71,12 @@ jobs:
7071 script : cd packages;find . -type d -path "*/runtimes/osx-*" -exec rm -rv {} +;find . -type d -path "*/runtimes/win-*" -exec rm -rv {} +;cd ..
7172 displayName : Clean up non-Linux runtime folders of NuGet Packages to save disk space
7273 - ${{ 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
7880 - script : dir /s "bin"
7981 displayName : show bin folder disk usage
8082 - ${{ if eq(parameters.nightlyBuild, 'true') }} :
@@ -89,27 +91,22 @@ jobs:
8991 Get-ChildItem -Path '.\bin\AnyCPU.*' -Recurse |
9092 Select -ExpandProperty FullName |
9193 Where {$_ -notlike '*\Microsoft.ML.NightlyBuild.Tests*'} |
92- sort length -Descending |
93- Remove-Item -force
94+ sort length -Descending |
95+ Remove-Item -force
9496 Write-Output "Done cleaning up usless project..."
9597 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 }}
9799 displayName : Build Nightly-Build Project with latest package versions
98100 - script : ${{ parameters.buildScript }} -$(_configuration) -runnightlybuildtests
99101 displayName : Run Nightly Build Tests
100102 - ${{ 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
107103 - ${{ if eq(parameters.innerLoop, 'false') }} :
108104 - ${{ 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 }}
110107 displayName : Run All Tests.
111108 - ${{ 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 }}
113110 displayName : Run Specific Tests.
114111 - ${{ if and(eq(parameters.buildScript, 'build.cmd'), eq(parameters.useVSTestTask, 'true')) }} :
115112 - task : VSTest@2
@@ -119,10 +116,10 @@ jobs:
119116 testAssemblyVer2 : |
120117 **\*test.dll
121118 **\*tests.dll
122- !**\obj\**
119+ !**\obj\**
123120 runSettingsFile : $(Build.SourcesDirectory)/tools-local/vstest.runsettings
124121 searchFolder : ' $(System.DefaultWorkingDirectory)'
125- vstestLocationMethod : ' version'
122+ vstestLocationMethod : ' version'
126123 vsTestVersion : ' latest'
127124 runInParallel : False
128125 runTestsInIsolation : True
@@ -133,17 +130,17 @@ jobs:
133130 collectDumpOn : onAbortOnly
134131 publishRunAttachments : true
135132 - ${{ 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 }}
137134 displayName : Run CI Tests.
138- - script : $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet msbuild -restore build/Codecoverage.proj
135+ - script : $(dotnetPath) msbuild -restore build/Codecoverage.proj
139136 displayName : Upload coverage to codecov.io
140137 condition : and(succeeded(), eq(${{ parameters.codeCoverage }}, True))
141138 - task : PublishTestResults@2
142139 displayName : Publish Test Results
143140 condition : succeededOrFailed()
144141 inputs :
145142 testRunner : ' vSTest'
146- searchFolder : ' $(System.DefaultWorkingDirectory)/bin '
143+ searchFolder : ' $(System.DefaultWorkingDirectory)/artifacts/TestResults '
147144 testResultsFiles : ' **/*.trx'
148145 testRunTitle : Machinelearning_Tests_${{ parameters.name }}_$(_configuration)_$(Build.BuildNumber)
149146 configuration : $(_configuration)
@@ -152,17 +149,16 @@ jobs:
152149 displayName : Stage build logs
153150 condition : not(succeeded())
154151 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/
158155 - task : CopyFiles@2
159156 displayName : Stage test output
160157 condition : not(succeeded())
161158 inputs :
162- sourceFolder : $(Build.SourcesDirectory)/bin
159+ sourceFolder : $(Build.SourcesDirectory)/artifacts/TestResults
163160 contents : |
164- **/TestOutput/**/*
165- **/*.trx
161+ **
166162 targetFolder : $(Build.ArtifactStagingDirectory)
167163 - task : CopyFiles@2
168164 displayName : Stage process dump and pdb if any
@@ -172,7 +168,7 @@ jobs:
172168 contents : |
173169 *.dmp
174170 CrashDumps/*.dmp
175- bin/**/*.pdb
171+ artifacts/ bin/**/*.pdb
176172 targetFolder : $(Build.ArtifactStagingDirectory)
177173 - task : PublishBuildArtifacts@1
178174 displayName : Publish build and test logs
@@ -182,5 +178,5 @@ jobs:
182178 artifactName : ${{ parameters.name }} $(_config_short)
183179 artifactType : container
184180 - ${{ if eq(parameters.nightlyBuild, 'false') }} :
185- - script : ${{ parameters.buildScript }} -buildPackages
181+ - script : ${{ parameters.buildScript }} -pack -ci
186182 displayName : Build Packages
0 commit comments