2 Agent.Source.Git.ShallowFetchDepth: 1
6 displayName: Windows Build
9 vmImage: windows-latest
13 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
14 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
15 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
17 displayName: 'Mount test-cache'
19 GITFILESHAREPWD: $(gitfileshare.pwd)
21 $urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
22 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
23 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
24 (New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
25 Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
26 Remove-Item git-sdk-64-minimal.zip
28 # Let Git ignore the SDK and the test-cache
29 "/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
30 displayName: 'Download git-sdk-64-minimal'
32 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
33 ci/make-test-artifacts.sh artifacts
38 HOME: $(Build.SourcesDirectory)
42 - task: PublishPipelineArtifact@0
43 displayName: 'Publish Pipeline Artifact: test artifacts'
45 artifactName: 'windows-artifacts'
46 targetPath: '$(Build.SourcesDirectory)\artifacts'
47 - task: PublishPipelineArtifact@0
48 displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal'
50 artifactName: 'git-sdk-64-minimal'
51 targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
53 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
54 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
56 displayName: 'Unmount test-cache'
59 GITFILESHAREPWD: $(gitfileshare.pwd)
62 displayName: Windows Test
63 dependsOn: windows_build
64 condition: succeeded()
66 vmImage: windows-latest
72 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
73 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
74 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
76 displayName: 'Mount test-cache'
78 GITFILESHAREPWD: $(gitfileshare.pwd)
79 - task: DownloadPipelineArtifact@0
80 displayName: 'Download Pipeline Artifact: test artifacts'
82 artifactName: 'windows-artifacts'
83 targetPath: '$(Build.SourcesDirectory)'
84 - task: DownloadPipelineArtifact@0
85 displayName: 'Download Pipeline Artifact: git-sdk-64-minimal'
87 artifactName: 'git-sdk-64-minimal'
88 targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
90 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
91 test -f artifacts.tar.gz || {
92 echo No test artifacts found\; skipping >&2
95 tar xf artifacts.tar.gz || exit 1
97 # Let Git ignore the SDK and the test-cache
98 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
100 ci/run-test-slice.sh `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE || {
101 ci/print-test-failures.sh
106 displayName: 'Test (parallel)'
108 HOME: $(Build.SourcesDirectory)
111 GIT_TEST_SKIP_REBASE_P: 1
113 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
114 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
116 displayName: 'Unmount test-cache'
119 GITFILESHAREPWD: $(gitfileshare.pwd)
120 - task: PublishTestResults@2
121 displayName: 'Publish Test Results **/TEST-*.xml'
123 mergeTestResults: true
124 testRunTitle: 'windows'
126 publishRunAttachments: false
127 condition: succeededOrFailed()
128 - task: PublishBuildArtifacts@1
129 displayName: 'Publish trash directories of failed tests'
132 PathtoPublish: t/failed-test-artifacts
133 ArtifactName: failed-test-artifacts
136 displayName: Visual Studio Build
137 condition: succeeded()
139 vmImage: windows-latest
140 timeoutInMinutes: 240
143 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
144 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
145 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
147 displayName: 'Mount test-cache'
149 GITFILESHAREPWD: $(gitfileshare.pwd)
151 $urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
152 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
153 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
154 (New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
155 Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
156 Remove-Item git-sdk-64-minimal.zip
158 # Let Git ignore the SDK and the test-cache
159 "/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
160 displayName: 'Download git-sdk-64-minimal'
162 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
163 make NDEBUG=1 DEVELOPER=1 vcxproj
166 displayName: Generate Visual Studio Solution
168 HOME: $(Build.SourcesDirectory)
172 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
174 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
175 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
176 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
177 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
178 Expand-Archive compat.zip -DestinationPath . -Force
179 Remove-Item compat.zip
180 displayName: 'Download vcpkg artifacts'
185 configuration: Release
187 msbuildArguments: /p:PlatformToolset=v142
189 & compat\vcbuild\vcpkg_copy_dlls.bat release
191 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
192 mkdir -p artifacts &&
193 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)\"
196 displayName: Bundle artifact tar
198 HOME: $(Build.SourcesDirectory)
203 VCPKG_ROOT: $(Build.SourcesDirectory)\compat\vcbuild\vcpkg
205 $tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content
206 $version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content
207 $url = "https://github.com/git-for-windows/git/releases/download/${tag}/PortableGit-${version}-64-bit.7z.exe"
208 (New-Object Net.WebClient).DownloadFile($url,"PortableGit.exe")
209 & .\PortableGit.exe -y -oartifacts\PortableGit
210 # Wait until it is unpacked
211 while (-not @(Remove-Item -ErrorAction SilentlyContinue PortableGit.exe; $?)) { sleep 1 }
212 displayName: Download & extract portable Git
213 - task: PublishPipelineArtifact@0
214 displayName: 'Publish Pipeline Artifact: MSVC test artifacts'
216 artifactName: 'vs-artifacts'
217 targetPath: '$(Build.SourcesDirectory)\artifacts'
219 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
220 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
222 displayName: 'Unmount test-cache'
225 GITFILESHAREPWD: $(gitfileshare.pwd)
228 displayName: Visual Studio Test
230 condition: succeeded()
232 vmImage: windows-latest
233 timeoutInMinutes: 240
238 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
239 net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
240 cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
242 displayName: 'Mount test-cache'
244 GITFILESHAREPWD: $(gitfileshare.pwd)
245 - task: DownloadPipelineArtifact@0
246 displayName: 'Download Pipeline Artifact: VS test artifacts'
248 artifactName: 'vs-artifacts'
249 targetPath: '$(Build.SourcesDirectory)'
251 & PortableGit\git-cmd.exe --command=usr\bin\bash.exe -lc @"
252 test -f artifacts.tar.gz || {
253 echo No test artifacts found\; skipping >&2
256 tar xf artifacts.tar.gz || exit 1
258 # Let Git ignore the SDK and the test-cache
259 printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude
262 PATH=\"`$PWD/helper:`$PATH\" &&
263 test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
264 `$(test-tool.exe path-utils slice-tests \
265 `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh)
268 displayName: 'Test (parallel)'
270 HOME: $(Build.SourcesDirectory)
273 GIT_TEST_SKIP_REBASE_P: 1
275 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
276 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
278 displayName: 'Unmount test-cache'
281 GITFILESHAREPWD: $(gitfileshare.pwd)
282 - task: PublishTestResults@2
283 displayName: 'Publish Test Results **/TEST-*.xml'
285 mergeTestResults: true
288 publishRunAttachments: false
289 condition: succeededOrFailed()
290 - task: PublishBuildArtifacts@1
291 displayName: 'Publish trash directories of failed tests'
294 PathtoPublish: t/failed-test-artifacts
295 ArtifactName: failed-vs-test-artifacts
298 displayName: linux-clang
299 condition: succeeded()
301 vmImage: ubuntu-latest
304 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
306 sudo apt-get update &&
307 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&
309 export CC=clang || exit 1
311 ci/install-dependencies.sh || exit 1
312 ci/run-build-and-tests.sh || {
313 ci/print-test-failures.sh
317 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
318 displayName: 'ci/run-build-and-tests.sh'
320 GITFILESHAREPWD: $(gitfileshare.pwd)
321 - task: PublishTestResults@2
322 displayName: 'Publish Test Results **/TEST-*.xml'
324 mergeTestResults: true
325 testRunTitle: 'linux-clang'
327 publishRunAttachments: false
328 condition: succeededOrFailed()
329 - task: PublishBuildArtifacts@1
330 displayName: 'Publish trash directories of failed tests'
333 PathtoPublish: t/failed-test-artifacts
334 ArtifactName: failed-test-artifacts
337 displayName: linux-gcc
338 condition: succeeded()
340 vmImage: ubuntu-latest
343 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
345 sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
346 sudo apt-get update &&
347 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
349 ci/install-dependencies.sh || exit 1
350 ci/run-build-and-tests.sh || {
351 ci/print-test-failures.sh
355 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
356 displayName: 'ci/run-build-and-tests.sh'
358 GITFILESHAREPWD: $(gitfileshare.pwd)
359 - task: PublishTestResults@2
360 displayName: 'Publish Test Results **/TEST-*.xml'
362 mergeTestResults: true
363 testRunTitle: 'linux-gcc'
365 publishRunAttachments: false
366 condition: succeededOrFailed()
367 - task: PublishBuildArtifacts@1
368 displayName: 'Publish trash directories of failed tests'
371 PathtoPublish: t/failed-test-artifacts
372 ArtifactName: failed-test-artifacts
375 displayName: osx-clang
376 condition: succeeded()
378 vmImage: macOS-latest
381 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
385 ci/install-dependencies.sh || exit 1
386 ci/run-build-and-tests.sh || {
387 ci/print-test-failures.sh
391 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
392 displayName: 'ci/run-build-and-tests.sh'
394 GITFILESHAREPWD: $(gitfileshare.pwd)
395 - task: PublishTestResults@2
396 displayName: 'Publish Test Results **/TEST-*.xml'
398 mergeTestResults: true
399 testRunTitle: 'osx-clang'
401 publishRunAttachments: false
402 condition: succeededOrFailed()
403 - task: PublishBuildArtifacts@1
404 displayName: 'Publish trash directories of failed tests'
407 PathtoPublish: t/failed-test-artifacts
408 ArtifactName: failed-test-artifacts
412 condition: succeeded()
414 vmImage: macOS-latest
417 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
419 ci/install-dependencies.sh || exit 1
420 ci/run-build-and-tests.sh || {
421 ci/print-test-failures.sh
425 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
426 displayName: 'ci/run-build-and-tests.sh'
428 GITFILESHAREPWD: $(gitfileshare.pwd)
429 - task: PublishTestResults@2
430 displayName: 'Publish Test Results **/TEST-*.xml'
432 mergeTestResults: true
433 testRunTitle: 'osx-gcc'
435 publishRunAttachments: false
436 condition: succeededOrFailed()
437 - task: PublishBuildArtifacts@1
438 displayName: 'Publish trash directories of failed tests'
441 PathtoPublish: t/failed-test-artifacts
442 ArtifactName: failed-test-artifacts
444 - job: gettext_poison
445 displayName: GETTEXT_POISON
446 condition: succeeded()
448 vmImage: ubuntu-latest
451 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
453 sudo apt-get update &&
454 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev &&
456 export jobname=GETTEXT_POISON || exit 1
458 ci/run-build-and-tests.sh || {
459 ci/print-test-failures.sh
463 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
464 displayName: 'ci/run-build-and-tests.sh'
466 GITFILESHAREPWD: $(gitfileshare.pwd)
467 - task: PublishTestResults@2
468 displayName: 'Publish Test Results **/TEST-*.xml'
470 mergeTestResults: true
471 testRunTitle: 'gettext-poison'
473 publishRunAttachments: false
474 condition: succeededOrFailed()
475 - task: PublishBuildArtifacts@1
476 displayName: 'Publish trash directories of failed tests'
479 PathtoPublish: t/failed-test-artifacts
480 ArtifactName: failed-test-artifacts
484 condition: succeeded()
486 vmImage: ubuntu-latest
489 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
492 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
494 sudo chmod a+r t/out/TEST-*.xml
495 test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts
497 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || res=1
499 displayName: 'ci/run-linux32-docker.sh'
501 GITFILESHAREPWD: $(gitfileshare.pwd)
502 - task: PublishTestResults@2
503 displayName: 'Publish Test Results **/TEST-*.xml'
505 mergeTestResults: true
506 testRunTitle: 'linux32'
508 publishRunAttachments: false
509 condition: succeededOrFailed()
510 - task: PublishBuildArtifacts@1
511 displayName: 'Publish trash directories of failed tests'
514 PathtoPublish: t/failed-test-artifacts
515 ArtifactName: failed-test-artifacts
517 - job: static_analysis
518 displayName: StaticAnalysis
519 condition: succeeded()
521 vmImage: ubuntu-latest
524 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
526 sudo apt-get update &&
527 sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext &&
529 export jobname=StaticAnalysis &&
531 ci/run-static-analysis.sh || exit 1
533 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
534 displayName: 'ci/run-static-analysis.sh'
536 GITFILESHAREPWD: $(gitfileshare.pwd)
539 displayName: Documentation
540 condition: succeeded()
542 vmImage: ubuntu-latest
545 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
547 sudo apt-get update &&
548 sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns &&
550 export ALREADY_HAVE_ASCIIDOCTOR=yes. &&
551 export jobname=Documentation &&
553 ci/test-documentation.sh || exit 1
555 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
556 displayName: 'ci/test-documentation.sh'
558 GITFILESHAREPWD: $(gitfileshare.pwd)