| 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 -Drun_e2e_tests: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 -Drun_e2e_tests: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 |
|
| 84 |
- job: windowsx64relwithdebinfo |
| 85 |
displayName: 'Build Windows x86 RelWithDebInfo' |
| 86 |
pool: |
| 87 |
name: Hosted VS2017 |
| 88 |
demands: |
| 89 |
- Cmd |
| 90 |
- msbuild |
| 91 |
- visualstudio |
| 92 |
- vstest |
| 93 |
|
| 94 |
steps: |
| 95 |
- task: BatchScript@1 |
| 96 |
displayName: 'Git submodule update' |
| 97 |
inputs: |
| 98 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 99 |
arguments: 'submodule update --init --force' |
| 100 |
|
| 101 |
- task: BatchScript@1 |
| 102 |
displayName: 'Git submodule clean' |
| 103 |
inputs: |
| 104 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 105 |
arguments: 'submodule foreach --recursive "git clean -xdff"' |
| 106 |
|
| 107 |
- task: BatchScript@1 |
| 108 |
displayName: 'Git clean' |
| 109 |
inputs: |
| 110 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 111 |
arguments: 'clean -xdff' |
| 112 |
|
| 113 |
- task: BatchScript@1 |
| 114 |
displayName: 'Setup VS Vars' |
| 115 |
inputs: |
| 116 |
filename: '"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"' |
| 117 |
modifyEnvironment: true |
| 118 |
|
| 119 |
- task: CMake@1 |
| 120 |
displayName: 'CMake ..' |
| 121 |
inputs: |
| 122 |
workingDirectory: 'build_x86' |
| 123 |
cmakeArgs: '.. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Drun_e2e_tests:bool=ON -Duse_cppunittest:bool=ON' |
| 124 |
|
| 125 |
- task: VSBuild@1 |
| 126 |
displayName: 'Build solution build_x86\*.sln' |
| 127 |
inputs: |
| 128 |
solution: 'build_x86\*.sln' |
| 129 |
platform: Win32 |
| 130 |
configuration: RelWithDebInfo |
| 131 |
maximumCpuCount: true |
| 132 |
|
| 133 |
- task: VSTest@2 |
| 134 |
displayName: 'VsTest - testAssemblies' |
| 135 |
inputs: |
| 136 |
testAssemblyVer2: | |
| 137 |
**\*test*.dll |
| 138 |
!**\obj\** |
| 139 |
vsTestVersion: 15.0 |
| 140 |
runTestsInIsolation: true |
| 141 |
|
| 142 |
- job: windowsx86debug |
| 143 |
displayName: 'Build Windows x86 Debug' |
| 144 |
pool: |
| 145 |
name: Hosted VS2017 |
| 146 |
demands: |
| 147 |
- Cmd |
| 148 |
- msbuild |
| 149 |
- visualstudio |
| 150 |
|
| 151 |
steps: |
| 152 |
- task: BatchScript@1 |
| 153 |
displayName: 'Git submodule update' |
| 154 |
inputs: |
| 155 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 156 |
arguments: 'submodule update --init --force' |
| 157 |
|
| 158 |
- task: BatchScript@1 |
| 159 |
displayName: 'Git submodule clean' |
| 160 |
inputs: |
| 161 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 162 |
arguments: 'submodule foreach --recursive "git clean -xdff"' |
| 163 |
|
| 164 |
- task: BatchScript@1 |
| 165 |
displayName: 'Git clean' |
| 166 |
inputs: |
| 167 |
filename: 'C:\Program Files\Git\bin\git.exe' |
| 168 |
arguments: 'clean -xdff' |
| 169 |
|
| 170 |
- powershell: | |
| 171 |
$url = "https://github.com/KindDragon/vld/releases/download/v2.5.1/vld-2.5.1-setup.exe" |
| 172 |
$outpath = "$(System.ArtifactsDirectory)/vld-2.5.1-setup.exe" |
| 173 |
|
| 174 |
$wc = New-Object System.Net.WebClient |
| 175 |
$wc.DownloadFile($url, $outpath) |
| 176 |
displayName: 'Download VLD' |
| 177 |
|
| 178 |
- task: BatchScript@1 |
| 179 |
displayName: 'Install VLD copy' |
| 180 |
inputs: |
| 181 |
filename: '$(System.ArtifactsDirectory)/vld-2.5.1-setup.exe' |
| 182 |
arguments: '/suppressmsgboxes /verysilent /norestart' |
| 183 |
modifyEnvironment: true |
| 184 |
|
| 185 |
- task: BatchScript@1 |
| 186 |
displayName: 'Set VLD path' |
| 187 |
inputs: |
| 188 |
filename: 'set_vld_vars.bat' |
| 189 |
modifyEnvironment: true |
| 190 |
|
| 191 |
- task: BatchScript@1 |
| 192 |
displayName: 'Setup VS Vars' |
| 193 |
inputs: |
| 194 |
filename: '"c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"' |
| 195 |
modifyEnvironment: true |
| 196 |
|
| 197 |
- task: CMake@1 |
| 198 |
displayName: CMake |
| 199 |
inputs: |
| 200 |
workingDirectory: 'build_x86' |
| 201 |
cmakeArgs: '.. -Drun_unittests:bool=ON -Drun_int_tests:bool=ON -Drun_e2e_tests:bool=ON' |
| 202 |
|
| 203 |
- task: VSBuild@1 |
| 204 |
displayName: 'Build solution build_x86\*.sln' |
| 205 |
inputs: |
| 206 |
solution: 'build_x86\*.sln' |
| 207 |
platform: Win32 |
| 208 |
configuration: Debug |
| 209 |
maximumCpuCount: true |
| 210 |
|
| 211 |
- task: CmdLine@1 |
| 212 |
displayName: 'Run ctest' |
| 213 |
inputs: |
| 214 |
filename: ctest |
| 215 |
arguments: '-C "Debug" -V --output-on-failure' |
| 216 |
workingFolder: 'build_x86' |
| 217 |
|
| 218 |
- job: linuxubuntu |
| 219 |
displayName: 'Build Linux Ubuntu 16.04' |
| 220 |
pool: |
| 221 |
name: Hosted Ubuntu 1604 |
| 222 |
steps: |
| 223 |
- bash: | |
| 224 |
sudo apt-get update |
| 225 |
sudo apt-get install curl build-essential pkg-config libcurl4-openssl-dev git cmake libssl-dev 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)' |