| 1 |
name: $(BuildID)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) |
| 2 |
resources: |
| 3 |
- repo: self |
| 4 |
clean: true |
| 5 |
jobs: |
| 6 |
- job: windowsx64debug |
| 7 |
displayName: 'Build Windows x64 Debug' |
| 8 |
pool: |
| 9 |
name: Hosted VS2017 |
| 10 |
demands: |
| 11 |
- Cmd |
| 12 |
- msbuild |
| 13 |
- visualstudio |
| 14 |
|
| 15 |
steps: |
| 16 |
- task: BatchScript@1 |
| 17 |
displayName: 'Git submodule update' |
| 18 |
inputs: |
| 19 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 20 |
arguments: 'submodule update --init --force' |
| 21 |
|
| 22 |
- task: BatchScript@1 |
| 23 |
displayName: 'Git submodule clean' |
| 24 |
inputs: |
| 25 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 26 |
arguments: 'submodule foreach --recursive "git clean -xdff"' |
| 27 |
|
| 28 |
- task: BatchScript@1 |
| 29 |
displayName: 'Git clean' |
| 30 |
inputs: |
| 31 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 32 |
arguments: 'clean -xdff' |
| 33 |
|
| 34 |
- powershell: | |
| 35 |
$url = "https://github.com/KindDragon/vld/releases/download/v2.5.1/vld-2.5.1-setup.exe" |
| 36 |
$outpath = "$(System.ArtifactsDirectory)/vld-2.5.1-setup.exe" |
| 37 |
|
| 38 |
$wc = New-Object System.Net.WebClient |
| 39 |
$wc.DownloadFile($url, $outpath) |
| 40 |
displayName: 'Download VLD' |
| 41 |
|
| 42 |
- task: BatchScript@1 |
| 43 |
displayName: 'Install VLD' |
| 44 |
inputs: |
| 45 |
filename: '$(System.ArtifactsDirectory)/vld-2.5.1-setup.exe' |
| 46 |
arguments: '/suppressmsgboxes /verysilent /norestart' |
| 47 |
modifyEnvironment: true |
| 48 |
|
| 49 |
- task: BatchScript@1 |
| 50 |
displayName: 'Set VLD path' |
| 51 |
inputs: |
| 52 |
filename: 'set_vld_vars.bat' |
| 53 |
modifyEnvironment: true |
| 54 |
|
| 55 |
- task: BatchScript@1 |
| 56 |
displayName: 'Setup VS Vars' |
| 57 |
inputs: |
| 58 |
filename: '"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"' |
| 59 |
modifyEnvironment: true |
| 60 |
|
| 61 |
- task: CMake@1 |
| 62 |
displayName: 'CMake .. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=OFF -G "Visual Studio 15 2017 Win64"' |
| 63 |
inputs: |
| 64 |
workingDirectory: 'build_x64' |
| 65 |
cmakeArgs: '.. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=OFF -G "Visual Studio 15 2017 Win64"' |
| 66 |
|
| 67 |
- task: VSBuild@1 |
| 68 |
displayName: 'Build solution build_x64\*.sln' |
| 69 |
inputs: |
| 70 |
solution: 'build_x64\*.sln' |
| 71 |
msbuildArgs: '/p:ForceImportBeforeCppTargets=$(Build.SourcesDirectory)/vld.props' |
| 72 |
platform: x64 |
| 73 |
configuration: Debug |
| 74 |
maximumCpuCount: true |
| 75 |
|
| 76 |
- task: CmdLine@1 |
| 77 |
displayName: 'Run ctest' |
| 78 |
inputs: |
| 79 |
filename: ctest |
| 80 |
arguments: '-C "Debug" -V --output-on-failure' |
| 81 |
workingFolder: 'build_x64' |
| 82 |
|
| 83 |
- job: windowsx64relwithdebinfo |
| 84 |
displayName: 'Build Windows x86 RelWithDebInfo' |
| 85 |
pool: |
| 86 |
name: Hosted VS2017 |
| 87 |
demands: |
| 88 |
- Cmd |
| 89 |
- msbuild |
| 90 |
- visualstudio |
| 91 |
- vstest |
| 92 |
|
| 93 |
steps: |
| 94 |
- task: BatchScript@1 |
| 95 |
displayName: 'Git submodule update' |
| 96 |
inputs: |
| 97 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 98 |
arguments: 'submodule update --init --force' |
| 99 |
|
| 100 |
- task: BatchScript@1 |
| 101 |
displayName: 'Git submodule clean' |
| 102 |
inputs: |
| 103 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 104 |
arguments: 'submodule foreach --recursive "git clean -xdff"' |
| 105 |
|
| 106 |
- task: BatchScript@1 |
| 107 |
displayName: 'Git clean' |
| 108 |
inputs: |
| 109 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 110 |
arguments: 'clean -xdff' |
| 111 |
|
| 112 |
- task: BatchScript@1 |
| 113 |
displayName: 'Setup VS Vars' |
| 114 |
inputs: |
| 115 |
filename: '"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"' |
| 116 |
modifyEnvironment: true |
| 117 |
|
| 118 |
- task: CMake@1 |
| 119 |
displayName: 'CMake .. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=ON' |
| 120 |
inputs: |
| 121 |
workingDirectory: 'build_x64' |
| 122 |
cmakeArgs: '.. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Duse_cppunittest:bool=ON' |
| 123 |
|
| 124 |
- task: VSBuild@1 |
| 125 |
displayName: 'Build solution build_x64\*.sln' |
| 126 |
inputs: |
| 127 |
solution: 'build_x64\*.sln' |
| 128 |
platform: Win32 |
| 129 |
configuration: RelWithDebInfo |
| 130 |
maximumCpuCount: true |
| 131 |
|
| 132 |
- task: VSTest@2 |
| 133 |
displayName: 'VsTest - testAssemblies' |
| 134 |
inputs: |
| 135 |
testAssemblyVer2: | |
| 136 |
**\*test*.dll |
| 137 |
!**\obj\** |
| 138 |
vsTestVersion: 15.0 |
| 139 |
runTestsInIsolation: true |
| 140 |
|
| 141 |
- job: windowsx86debug |
| 142 |
displayName: 'Build Windows x86 Debug' |
| 143 |
pool: |
| 144 |
name: Hosted VS2017 |
| 145 |
demands: |
| 146 |
- Cmd |
| 147 |
- msbuild |
| 148 |
- visualstudio |
| 149 |
|
| 150 |
steps: |
| 151 |
- task: BatchScript@1 |
| 152 |
displayName: 'Git submodule update' |
| 153 |
inputs: |
| 154 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 155 |
arguments: 'submodule update --init --force' |
| 156 |
|
| 157 |
- task: BatchScript@1 |
| 158 |
displayName: 'Git submodule clean' |
| 159 |
inputs: |
| 160 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 161 |
arguments: 'submodule foreach --recursive "git clean -xdff"' |
| 162 |
|
| 163 |
- task: BatchScript@1 |
| 164 |
displayName: 'Git clean' |
| 165 |
inputs: |
| 166 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 167 |
arguments: 'clean -xdff' |
| 168 |
|
| 169 |
- powershell: | |
| 170 |
$url = "https://github.com/KindDragon/vld/releases/download/v2.5.1/vld-2.5.1-setup.exe" |
| 171 |
$outpath = "$(System.ArtifactsDirectory)/vld-2.5.1-setup.exe" |
| 172 |
|
| 173 |
$wc = New-Object System.Net.WebClient |
| 174 |
$wc.DownloadFile($url, $outpath) |
| 175 |
displayName: 'Download VLD' |
| 176 |
|
| 177 |
- task: BatchScript@1 |
| 178 |
displayName: 'Install VLD copy' |
| 179 |
inputs: |
| 180 |
filename: '$(System.ArtifactsDirectory)/vld-2.5.1-setup.exe' |
| 181 |
arguments: '/suppressmsgboxes /verysilent /norestart' |
| 182 |
modifyEnvironment: true |
| 183 |
|
| 184 |
- task: BatchScript@1 |
| 185 |
displayName: 'Set VLD path' |
| 186 |
inputs: |
| 187 |
filename: 'set_vld_vars.bat' |
| 188 |
modifyEnvironment: true |
| 189 |
|
| 190 |
- task: BatchScript@1 |
| 191 |
displayName: 'Setup VS Vars' |
| 192 |
inputs: |
| 193 |
filename: '"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"' |
| 194 |
modifyEnvironment: true |
| 195 |
|
| 196 |
- task: CMake@1 |
| 197 |
displayName: CMake |
| 198 |
inputs: |
| 199 |
workingDirectory: 'build_x86' |
| 200 |
cmakeArgs: '.. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Drun_e2e_tests:bool=ON' |
| 201 |
|
| 202 |
- task: VSBuild@1 |
| 203 |
displayName: 'Build solution build_x86\*.sln' |
| 204 |
inputs: |
| 205 |
solution: 'build_x86\*.sln' |
| 206 |
platform: Win32 |
| 207 |
configuration: Debug |
| 208 |
maximumCpuCount: true |
| 209 |
|
| 210 |
- task: CmdLine@1 |
| 211 |
displayName: 'Run ctest' |
| 212 |
inputs: |
| 213 |
filename: ctest |
| 214 |
arguments: '-C "Debug" -V --output-on-failure' |
| 215 |
workingFolder: 'build_x86' |
| 216 |
|
| 217 |
- job: linuxubuntu |
| 218 |
displayName: 'Build Linux Ubuntu 16.04' |
| 219 |
pool: |
| 220 |
name: Hosted Ubuntu 1604 |
| 221 |
|
| 222 |
steps: |
| 223 |
- bash: | |
| 224 |
sudo apt-get update |
| 225 |
sudo apt-get install build-essential pkg-config git cmake uuid-dev valgrind |
| 226 |
displayName: 'Bash Script' |
| 227 |
|
| 228 |
- bash: | |
| 229 |
pushd $(Build.Repository.LocalPath) |
| 230 |
git submodule update --init |
| 231 |
git submodule foreach --recursive "git clean -xdff" |
| 232 |
git clean -xdff |
| 233 |
popd |
| 234 |
workingDirectory: '$(Build.Repository.LocalPath)' |
| 235 |
displayName: 'git submodule update and clean' |
| 236 |
|
| 237 |
- task: Bash@3 |
| 238 |
displayName: 'Build and run tests' |
| 239 |
inputs: |
| 240 |
targetType: filePath |
| 241 |
filePath: './build/linux/build_linux.sh' |
| 242 |
arguments: '$(Build.Repository.LocalPath)' |
| 243 |
workingDirectory: '$(Build.Repository.LocalPath)' |
| 244 |
|
| 245 |
- job: Traceability |
| 246 |
pool: |
| 247 |
name: Hosted VS2017 |
| 248 |
demands: |
| 249 |
- Cmd |
| 250 |
- msbuild |
| 251 |
- visualstudio |
| 252 |
condition: false |
| 253 |
|
| 254 |
steps: |
| 255 |
- task: BatchScript@1 |
| 256 |
displayName: 'Git submodule update' |
| 257 |
inputs: |
| 258 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 259 |
arguments: 'submodule update --init --force deps/azure-c-build-tools' |
| 260 |
|
| 261 |
- task: BatchScript@1 |
| 262 |
displayName: 'Git submodule clean' |
| 263 |
inputs: |
| 264 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 265 |
arguments: 'submodule foreach --recursive "git clean -xdff"' |
| 266 |
|
| 267 |
- task: BatchScript@1 |
| 268 |
displayName: 'Git clean' |
| 269 |
inputs: |
| 270 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 271 |
arguments: 'clean -xdff' |
| 272 |
|
| 273 |
- task: BatchScript@1 |
| 274 |
displayName: 'Setup VS Vars' |
| 275 |
inputs: |
| 276 |
filename: '"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"' |
| 277 |
modifyEnvironment: true |
| 278 |
|
| 279 |
- task: NuGetCommand@2 |
| 280 |
displayName: 'NuGet restore' |
| 281 |
inputs: |
| 282 |
restoreSolution: deps/azure-c-build-tools/traceabilitytool/traceabilitytool.sln |
| 283 |
|
| 284 |
- task: VSBuild@1 |
| 285 |
displayName: 'Build solution deps/azure-c-build-tools/traceabilitytool/traceabilitytool.sln' |
| 286 |
inputs: |
| 287 |
solution: deps/azure-c-build-tools/traceabilitytool/traceabilitytool.sln |
| 288 |
platform: 'Any CPU' |
| 289 |
configuration: Release |
| 290 |
maximumCpuCount: true |
| 291 |
|
| 292 |
- task: BatchScript@1 |
| 293 |
displayName: 'Run traceability tool' |
| 294 |
inputs: |
| 295 |
filename: 'deps/azure-c-build-tools/traceabilitytool/traceability_tool/bin/Release/traceabilitytool.exe' |
| 296 |
arguments: '-i $(Build.SourcesDirectory) -buildcheck -e deps' |
| 297 |
modifyEnvironment: false |
| 298 |
workingFolder: '$(Build.SourcesDirectory)' |