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 # Helper to check the error level of the latest command (exit with error when appropriate)
22 function c() { if (!$?) { exit(1) } }
24 # Add build agent's MinGit to PATH
25 $env:PATH = $env:AGENT_HOMEDIRECTORY +"\externals\\git\cmd;" +$env:PATH
27 # Helper to initialize (or update) a Git worktree
28 function init ($path, $url, $set_origin) {
29 if (Test-Path $path) {
40 & git config core.autocrlf false; c
41 & git config core.untrackedCache true; c
42 if (($set_origin -ne 0) -and !(git config remote.origin.url)) {
43 & git remote add origin $url; c
45 & git fetch --depth=1 $url master; c
46 & git reset --hard FETCH_HEAD; c
50 # Initialize Git for Windows' SDK
51 $sdk_path = "$(Build.SourcesDirectory)\git-sdk-64"
52 init "$sdk_path" "https://dev.azure.com/git-for-windows/git-sdk-64/_git/git-sdk-64" 0
54 # Let Git ignore the SDK and the test-cache
55 "/git-sdk-64/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
56 displayName: 'Initialize the Git for Windows SDK'
58 & "git-sdk-64\git-cmd.exe" --command=usr\\bin\\bash.exe -lc @"
62 export GIT_TEST_SKIP_REBASE_P=1
64 ci/run-build-and-tests.sh || {
65 ci/print-test-failures.sh
70 displayName: 'Build & Test'
72 HOME: $(Build.SourcesDirectory)
75 if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
76 cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
78 displayName: 'Unmount test-cache'
81 GITFILESHAREPWD: $(gitfileshare.pwd)
82 - task: PublishTestResults@2
83 displayName: 'Publish Test Results **/TEST-*.xml'
85 mergeTestResults: true
86 testRunTitle: 'windows'
88 publishRunAttachments: false
89 condition: succeededOrFailed()
90 - task: PublishBuildArtifacts@1
91 displayName: 'Publish trash directories of failed tests'
94 PathtoPublish: t/failed-test-artifacts
95 ArtifactName: failed-test-artifacts
98 displayName: linux-clang
99 condition: succeeded()
100 pool: Hosted Ubuntu 1604
103 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
105 sudo apt-get update &&
106 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&
108 export CC=clang || exit 1
110 ci/install-dependencies.sh || exit 1
111 ci/run-build-and-tests.sh || {
112 ci/print-test-failures.sh
116 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
117 displayName: 'ci/run-build-and-tests.sh'
119 GITFILESHAREPWD: $(gitfileshare.pwd)
120 - task: PublishTestResults@2
121 displayName: 'Publish Test Results **/TEST-*.xml'
123 mergeTestResults: true
124 testRunTitle: 'linux-clang'
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: linux-gcc
137 condition: succeeded()
138 pool: Hosted Ubuntu 1604
141 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
143 sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
144 sudo apt-get update &&
145 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
147 ci/install-dependencies.sh || exit 1
148 ci/run-build-and-tests.sh || {
149 ci/print-test-failures.sh
153 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
154 displayName: 'ci/run-build-and-tests.sh'
156 GITFILESHAREPWD: $(gitfileshare.pwd)
157 - task: PublishTestResults@2
158 displayName: 'Publish Test Results **/TEST-*.xml'
160 mergeTestResults: true
161 testRunTitle: 'linux-gcc'
163 publishRunAttachments: false
164 condition: succeededOrFailed()
165 - task: PublishBuildArtifacts@1
166 displayName: 'Publish trash directories of failed tests'
169 PathtoPublish: t/failed-test-artifacts
170 ArtifactName: failed-test-artifacts
173 displayName: osx-clang
174 condition: succeeded()
178 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
182 ci/install-dependencies.sh || exit 1
183 ci/run-build-and-tests.sh || {
184 ci/print-test-failures.sh
188 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
189 displayName: 'ci/run-build-and-tests.sh'
191 GITFILESHAREPWD: $(gitfileshare.pwd)
192 - task: PublishTestResults@2
193 displayName: 'Publish Test Results **/TEST-*.xml'
195 mergeTestResults: true
196 testRunTitle: 'osx-clang'
198 publishRunAttachments: false
199 condition: succeededOrFailed()
200 - task: PublishBuildArtifacts@1
201 displayName: 'Publish trash directories of failed tests'
204 PathtoPublish: t/failed-test-artifacts
205 ArtifactName: failed-test-artifacts
209 condition: succeeded()
213 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
215 ci/install-dependencies.sh || exit 1
216 ci/run-build-and-tests.sh || {
217 ci/print-test-failures.sh
221 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
222 displayName: 'ci/run-build-and-tests.sh'
224 GITFILESHAREPWD: $(gitfileshare.pwd)
225 - task: PublishTestResults@2
226 displayName: 'Publish Test Results **/TEST-*.xml'
228 mergeTestResults: true
229 testRunTitle: 'osx-gcc'
231 publishRunAttachments: false
232 condition: succeededOrFailed()
233 - task: PublishBuildArtifacts@1
234 displayName: 'Publish trash directories of failed tests'
237 PathtoPublish: t/failed-test-artifacts
238 ArtifactName: failed-test-artifacts
240 - job: gettext_poison
241 displayName: GETTEXT_POISON
242 condition: succeeded()
243 pool: Hosted Ubuntu 1604
246 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
248 sudo apt-get update &&
249 sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev &&
251 export jobname=GETTEXT_POISON || exit 1
253 ci/run-build-and-tests.sh || {
254 ci/print-test-failures.sh
258 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
259 displayName: 'ci/run-build-and-tests.sh'
261 GITFILESHAREPWD: $(gitfileshare.pwd)
262 - task: PublishTestResults@2
263 displayName: 'Publish Test Results **/TEST-*.xml'
265 mergeTestResults: true
266 testRunTitle: 'gettext-poison'
268 publishRunAttachments: false
269 condition: succeededOrFailed()
270 - task: PublishBuildArtifacts@1
271 displayName: 'Publish trash directories of failed tests'
274 PathtoPublish: t/failed-test-artifacts
275 ArtifactName: failed-test-artifacts
279 condition: succeeded()
280 pool: Hosted Ubuntu 1604
283 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
286 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
288 sudo chmod a+r t/out/TEST-*.xml
289 test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts
291 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || res=1
293 displayName: 'ci/run-linux32-docker.sh'
295 GITFILESHAREPWD: $(gitfileshare.pwd)
296 - task: PublishTestResults@2
297 displayName: 'Publish Test Results **/TEST-*.xml'
299 mergeTestResults: true
300 testRunTitle: 'linux32'
302 publishRunAttachments: false
303 condition: succeededOrFailed()
304 - task: PublishBuildArtifacts@1
305 displayName: 'Publish trash directories of failed tests'
308 PathtoPublish: t/failed-test-artifacts
309 ArtifactName: failed-test-artifacts
311 - job: static_analysis
312 displayName: StaticAnalysis
313 condition: succeeded()
314 pool: Hosted Ubuntu 1604
317 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
319 sudo apt-get update &&
320 sudo apt-get install -y coccinelle &&
322 export jobname=StaticAnalysis &&
324 ci/run-static-analysis.sh || exit 1
326 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
327 displayName: 'ci/run-static-analysis.sh'
329 GITFILESHAREPWD: $(gitfileshare.pwd)
332 displayName: Documentation
333 condition: succeeded()
334 pool: Hosted Ubuntu 1604
337 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
339 sudo apt-get update &&
340 sudo apt-get install -y asciidoc xmlto asciidoctor &&
342 export ALREADY_HAVE_ASCIIDOCTOR=yes. &&
343 export jobname=Documentation &&
345 ci/test-documentation.sh || exit 1
347 test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
348 displayName: 'ci/test-documentation.sh'
350 GITFILESHAREPWD: $(gitfileshare.pwd)