2 Agent.Source.Git.ShallowFetchDepth: 1
6 displayName: Windows Build
12 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
13 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
14 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
16 displayName: 'Mount test-cache'
18 GITFILESHAREPWD: $(gitfileshare.pwd)
20 $urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
21 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
22 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
23 (New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
24 Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
25 Remove-Item git-sdk-64-minimal.zip
27 # Let Git ignore the SDK and the test-cache
28 "/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
29 displayName: 'Download git-sdk-64-minimal'
31 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
32 ci/make-test-artifacts.sh artifacts
37 HOME: $(Build.SourcesDirectory)
41 - task: PublishPipelineArtifact@0
42 displayName: 'Publish Pipeline Artifact: test artifacts'
44 artifactName: 'windows-artifacts'
45 targetPath: '$(Build.SourcesDirectory)\artifacts'
46 - task: PublishPipelineArtifact@0
47 displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal'
49 artifactName: 'git-sdk-64-minimal'
50 targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
52 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
53 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
55 displayName: 'Unmount test-cache'
58 GITFILESHAREPWD: $(gitfileshare.pwd)
61 displayName: Windows Test
62 dependsOn: windows_build
63 condition: succeeded()
70 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
71 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
72 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
74 displayName: 'Mount test-cache'
76 GITFILESHAREPWD: $(gitfileshare.pwd)
77 - task: DownloadPipelineArtifact@0
78 displayName: 'Download Pipeline Artifact: test artifacts'
80 artifactName: 'windows-artifacts'
81 targetPath: '$(Build.SourcesDirectory)'
82 - task: DownloadPipelineArtifact@0
83 displayName: 'Download Pipeline Artifact: git-sdk-64-minimal'
85 artifactName: 'git-sdk-64-minimal'
86 targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
88 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
89 test -f artifacts.tar.gz || {
90 echo No test artifacts found\; skipping >&2
93 tar xf artifacts.tar.gz || exit 1
95 # Let Git ignore the SDK and the test-cache
96 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
98 ci/run-test-slice.sh `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE || {
99 ci/print-test-failures.sh
104 displayName: 'Test (parallel)'
106 HOME: $(Build.SourcesDirectory)
109 GIT_TEST_SKIP_REBASE_P: 1
111 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
112 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
114 displayName: 'Unmount test-cache'
117 GITFILESHAREPWD: $(gitfileshare.pwd)
118 - task: PublishTestResults@2
119 displayName: 'Publish Test Results **/TEST-*.xml'
121 mergeTestResults: true
122 testRunTitle: 'windows'
124 publishRunAttachments: false
125 condition: succeededOrFailed()
126 - task: PublishBuildArtifacts@1
127 displayName: 'Publish trash directories of failed tests'
130 PathtoPublish: t/failed-test-artifacts
131 ArtifactName: failed-test-artifacts
134 displayName: Visual Studio Build
135 condition: succeeded()
137 timeoutInMinutes: 240
140 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
141 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
142 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
144 displayName: 'Mount test-cache'
146 GITFILESHAREPWD: $(gitfileshare.pwd)
148 $urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
149 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
150 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
151 (New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
152 Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
153 Remove-Item git-sdk-64-minimal.zip
155 # Let Git ignore the SDK and the test-cache
156 "/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
157 displayName: 'Download git-sdk-64-minimal'
159 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
160 make NDEBUG=1 DEVELOPER=1 vcxproj
163 displayName: Generate Visual Studio Solution
165 HOME: $(Build.SourcesDirectory)
169 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
171 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
172 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
173 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
174 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
175 Expand-Archive compat.zip -DestinationPath . -Force
176 Remove-Item compat.zip
177 displayName: 'Download vcpkg artifacts'
182 configuration: Release
185 & compat\vcbuild\vcpkg_copy_dlls.bat release
187 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
188 mkdir -p artifacts &&
189 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)\"
192 displayName: Bundle artifact tar
194 HOME: $(Build.SourcesDirectory)
199 VCPKG_ROOT: $(Build.SourcesDirectory)\compat\vcbuild\vcpkg
201 $tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content
202 $version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content
203 $url = "https://github.com/git-for-windows/git/releases/download/${tag}/PortableGit-${version}-64-bit.7z.exe"
204 (New-Object Net.WebClient).DownloadFile($url,"PortableGit.exe")
205 & .\PortableGit.exe -y -oartifacts\PortableGit
206 # Wait until it is unpacked
207 while (-not @(Remove-Item -ErrorAction SilentlyContinue PortableGit.exe; $?)) { sleep 1 }
208 displayName: Download & extract portable Git
209 - task: PublishPipelineArtifact@0
210 displayName: 'Publish Pipeline Artifact: MSVC test artifacts'
212 artifactName: 'vs-artifacts'
213 targetPath: '$(Build.SourcesDirectory)\artifacts'
215 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
216 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
218 displayName: 'Unmount test-cache'
221 GITFILESHAREPWD: $(gitfileshare.pwd)
224 displayName: Visual Studio Test
226 condition: succeeded()
228 timeoutInMinutes: 240
233 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
234 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
235 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
237 displayName: 'Mount test-cache'
239 GITFILESHAREPWD: $(gitfileshare.pwd)
240 - task: DownloadPipelineArtifact@0
241 displayName: 'Download Pipeline Artifact: VS test artifacts'
243 artifactName: 'vs-artifacts'
244 targetPath: '$(Build.SourcesDirectory)'
246 & PortableGit\git-cmd.exe --command=usr\bin\bash.exe -lc @"
247 test -f artifacts.tar.gz || {
248 echo No test artifacts found\; skipping >&2
251 tar xf artifacts.tar.gz || exit 1
253 # Let Git ignore the SDK and the test-cache
254 printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude
257 PATH=\"`$PWD/helper:`$PATH\" &&
258 test-tool.exe run-command testsuite -V -x --write-junit-xml \
259 `$(test-tool.exe path-utils slice-tests \
260 `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh)
263 displayName: 'Test (parallel)'
265 HOME: $(Build.SourcesDirectory)
268 GIT_TEST_SKIP_REBASE_P: 1
270 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
271 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
273 displayName: 'Unmount test-cache'
276 GITFILESHAREPWD: $(gitfileshare.pwd)
277 - task: PublishTestResults@2
278 displayName: 'Publish Test Results **/TEST-*.xml'
280 mergeTestResults: true
283 publishRunAttachments: false
284 condition: succeededOrFailed()
285 - task: PublishBuildArtifacts@1
286 displayName: 'Publish trash directories of failed tests'
289 PathtoPublish: t/failed-test-artifacts
290 ArtifactName: failed-vs-test-artifacts
293 displayName: linux-clang
294 condition: succeeded()
295 pool: Hosted Ubuntu 1604
298 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
300 sudo apt-get update &&
301 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&
303 export CC=clang || exit 1
305 ci/install-dependencies.sh || exit 1
306 ci/run-build-and-tests.sh || {
307 ci/print-test-failures.sh
311 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
312 displayName: 'ci/run-build-and-tests.sh'
314 GITFILESHAREPWD: $(gitfileshare.pwd)
315 - task: PublishTestResults@2
316 displayName: 'Publish Test Results **/TEST-*.xml'
318 mergeTestResults: true
319 testRunTitle: 'linux-clang'
321 publishRunAttachments: false
322 condition: succeededOrFailed()
323 - task: PublishBuildArtifacts@1
324 displayName: 'Publish trash directories of failed tests'
327 PathtoPublish: t/failed-test-artifacts
328 ArtifactName: failed-test-artifacts
331 displayName: linux-gcc
332 condition: succeeded()
333 pool: Hosted Ubuntu 1604
336 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
338 sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
339 sudo apt-get update &&
340 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2 language-pack-is git-svn gcc-8 || exit 1
342 ci/install-dependencies.sh || exit 1
343 ci/run-build-and-tests.sh || {
344 ci/print-test-failures.sh
348 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
349 displayName: 'ci/run-build-and-tests.sh'
351 GITFILESHAREPWD: $(gitfileshare.pwd)
352 - task: PublishTestResults@2
353 displayName: 'Publish Test Results **/TEST-*.xml'
355 mergeTestResults: true
356 testRunTitle: 'linux-gcc'
358 publishRunAttachments: false
359 condition: succeededOrFailed()
360 - task: PublishBuildArtifacts@1
361 displayName: 'Publish trash directories of failed tests'
364 PathtoPublish: t/failed-test-artifacts
365 ArtifactName: failed-test-artifacts
368 displayName: osx-clang
369 condition: succeeded()
373 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
377 ci/install-dependencies.sh || exit 1
378 ci/run-build-and-tests.sh || {
379 ci/print-test-failures.sh
383 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
384 displayName: 'ci/run-build-and-tests.sh'
386 GITFILESHAREPWD: $(gitfileshare.pwd)
387 - task: PublishTestResults@2
388 displayName: 'Publish Test Results **/TEST-*.xml'
390 mergeTestResults: true
391 testRunTitle: 'osx-clang'
393 publishRunAttachments: false
394 condition: succeededOrFailed()
395 - task: PublishBuildArtifacts@1
396 displayName: 'Publish trash directories of failed tests'
399 PathtoPublish: t/failed-test-artifacts
400 ArtifactName: failed-test-artifacts
404 condition: succeeded()
408 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
410 ci/install-dependencies.sh || exit 1
411 ci/run-build-and-tests.sh || {
412 ci/print-test-failures.sh
416 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
417 displayName: 'ci/run-build-and-tests.sh'
419 GITFILESHAREPWD: $(gitfileshare.pwd)
420 - task: PublishTestResults@2
421 displayName: 'Publish Test Results **/TEST-*.xml'
423 mergeTestResults: true
424 testRunTitle: 'osx-gcc'
426 publishRunAttachments: false
427 condition: succeededOrFailed()
428 - task: PublishBuildArtifacts@1
429 displayName: 'Publish trash directories of failed tests'
432 PathtoPublish: t/failed-test-artifacts
433 ArtifactName: failed-test-artifacts
435 - job: gettext_poison
436 displayName: GETTEXT_POISON
437 condition: succeeded()
438 pool: Hosted Ubuntu 1604
441 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
443 sudo apt-get update &&
444 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev &&
446 export jobname=GETTEXT_POISON || exit 1
448 ci/run-build-and-tests.sh || {
449 ci/print-test-failures.sh
453 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
454 displayName: 'ci/run-build-and-tests.sh'
456 GITFILESHAREPWD: $(gitfileshare.pwd)
457 - task: PublishTestResults@2
458 displayName: 'Publish Test Results **/TEST-*.xml'
460 mergeTestResults: true
461 testRunTitle: 'gettext-poison'
463 publishRunAttachments: false
464 condition: succeededOrFailed()
465 - task: PublishBuildArtifacts@1
466 displayName: 'Publish trash directories of failed tests'
469 PathtoPublish: t/failed-test-artifacts
470 ArtifactName: failed-test-artifacts
474 condition: succeeded()
475 pool: Hosted Ubuntu 1604
478 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
481 sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS="$MAKEFLAGS" bash -lxc ci/run-linux32-docker.sh || res=1
483 sudo chmod a+r t/out/TEST-*.xml
484 test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts
486 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || res=1
488 displayName: 'ci/run-linux32-docker.sh'
490 GITFILESHAREPWD: $(gitfileshare.pwd)
491 - task: PublishTestResults@2
492 displayName: 'Publish Test Results **/TEST-*.xml'
494 mergeTestResults: true
495 testRunTitle: 'linux32'
497 publishRunAttachments: false
498 condition: succeededOrFailed()
499 - task: PublishBuildArtifacts@1
500 displayName: 'Publish trash directories of failed tests'
503 PathtoPublish: t/failed-test-artifacts
504 ArtifactName: failed-test-artifacts
506 - job: static_analysis
507 displayName: StaticAnalysis
508 condition: succeeded()
509 pool: Hosted Ubuntu 1604
512 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
514 sudo apt-get update &&
515 sudo apt-get install -y coccinelle &&
517 export jobname=StaticAnalysis &&
519 ci/run-static-analysis.sh || exit 1
521 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
522 displayName: 'ci/run-static-analysis.sh'
524 GITFILESHAREPWD: $(gitfileshare.pwd)
527 displayName: Documentation
528 condition: succeeded()
529 pool: Hosted Ubuntu 1604
532 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
534 sudo apt-get update &&
535 sudo apt-get install -y asciidoc xmlto asciidoctor &&
537 export ALREADY_HAVE_ASCIIDOCTOR=yes. &&
538 export jobname=Documentation &&
540 ci/test-documentation.sh || exit 1
542 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
543 displayName: 'ci/test-documentation.sh'
545 GITFILESHAREPWD: $(gitfileshare.pwd)