summaryrefslogtreecommitdiff
path: root/azure-pipelines.yml
blob: af2a5ea4845fd2af06e99ed1619f44c167055294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
variables:
  Agent.Source.Git.ShallowFetchDepth: 1

jobs:
- job: windows_build
  displayName: Windows Build
  condition: succeeded()
  pool: Hosted
  timeoutInMinutes: 240
  steps:
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
        cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
      }
    displayName: 'Mount test-cache'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - powershell: |
      $urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
      $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
      $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
      (New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
      Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
      Remove-Item git-sdk-64-minimal.zip

      # Let Git ignore the SDK and the test-cache
      "/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
    displayName: 'Download git-sdk-64-minimal'
  - powershell: |
      & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
        ci/make-test-artifacts.sh artifacts
      "@
      if (!$?) { exit(1) }
    displayName: Build
    env:
      HOME: $(Build.SourcesDirectory)
      MSYSTEM: MINGW64
      DEVELOPER: 1
      NO_PERL: 1
  - task: PublishPipelineArtifact@0
    displayName: 'Publish Pipeline Artifact: test artifacts'
    inputs:
      artifactName: 'windows-artifacts'
      targetPath: '$(Build.SourcesDirectory)\artifacts'
  - task: PublishPipelineArtifact@0
    displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal'
    inputs:
      artifactName: 'git-sdk-64-minimal'
      targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
      }
    displayName: 'Unmount test-cache'
    condition: true
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)

- job: windows_test
  displayName: Windows Test
  dependsOn: windows_build
  condition: succeeded()
  pool: Hosted
  timeoutInMinutes: 240
  strategy:
    parallel: 10
  steps:
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
        cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
      }
    displayName: 'Mount test-cache'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: DownloadPipelineArtifact@0
    displayName: 'Download Pipeline Artifact: test artifacts'
    inputs:
      artifactName: 'windows-artifacts'
      targetPath: '$(Build.SourcesDirectory)'
  - task: DownloadPipelineArtifact@0
    displayName: 'Download Pipeline Artifact: git-sdk-64-minimal'
    inputs:
      artifactName: 'git-sdk-64-minimal'
      targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
  - powershell: |
      & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
        test -f artifacts.tar.gz || {
          echo No test artifacts found\; skipping >&2
          exit 0
        }
        tar xf artifacts.tar.gz || exit 1

        # Let Git ignore the SDK and the test-cache
        printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude

        ci/run-test-slice.sh `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE || {
          ci/print-test-failures.sh
          exit 1
        }
      "@
      if (!$?) { exit(1) }
    displayName: 'Test (parallel)'
    env:
      HOME: $(Build.SourcesDirectory)
      MSYSTEM: MINGW64
      NO_SVN_TESTS: 1
      GIT_TEST_SKIP_REBASE_P: 1
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
      }
    displayName: 'Unmount test-cache'
    condition: true
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'windows'
      platform: Windows
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: vs_build
  displayName: Visual Studio Build
  condition: succeeded()
  pool: Hosted VS2017
  timeoutInMinutes: 240
  steps:
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
        cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
      }
    displayName: 'Mount test-cache'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - powershell: |
      $urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
      $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
      $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
      (New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
      Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
      Remove-Item git-sdk-64-minimal.zip

      # Let Git ignore the SDK and the test-cache
      "/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
    displayName: 'Download git-sdk-64-minimal'
  - powershell: |
      & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
        make NDEBUG=1 DEVELOPER=1 vcxproj
      "@
      if (!$?) { exit(1) }
    displayName: Generate Visual Studio Solution
    env:
      HOME: $(Build.SourcesDirectory)
      MSYSTEM: MINGW64
      DEVELOPER: 1
      NO_PERL: 1
      GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
  - powershell: |
      $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
      $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
      $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
      (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
      Expand-Archive compat.zip -DestinationPath . -Force
      Remove-Item compat.zip
    displayName: 'Download vcpkg artifacts'
  - task: MSBuild@1
    inputs:
      solution: git.sln
      platform: x64
      configuration: Release
      maximumCpuCount: 4
  - powershell: |
      & compat\vcbuild\vcpkg_copy_dlls.bat release
      if (!$?) { exit(1) }
      & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
        mkdir -p artifacts &&
        eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)\"
      "@
      if (!$?) { exit(1) }
    displayName: Bundle artifact tar
    env:
      HOME: $(Build.SourcesDirectory)
      MSYSTEM: MINGW64
      DEVELOPER: 1
      NO_PERL: 1
      MSVC: 1
      VCPKG_ROOT: $(Build.SourcesDirectory)\compat\vcbuild\vcpkg
  - powershell: |
      $tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content
      $version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content
      $url = "https://github.com/git-for-windows/git/releases/download/${tag}/PortableGit-${version}-64-bit.7z.exe"
      (New-Object Net.WebClient).DownloadFile($url,"PortableGit.exe")
      & .\PortableGit.exe -y -oartifacts\PortableGit
      # Wait until it is unpacked
      while (-not @(Remove-Item -ErrorAction SilentlyContinue PortableGit.exe; $?)) { sleep 1 }
    displayName: Download & extract portable Git
  - task: PublishPipelineArtifact@0
    displayName: 'Publish Pipeline Artifact: MSVC test artifacts'
    inputs:
      artifactName: 'vs-artifacts'
      targetPath: '$(Build.SourcesDirectory)\artifacts'
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
      }
    displayName: 'Unmount test-cache'
    condition: true
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)

- job: vs_test
  displayName: Visual Studio Test
  dependsOn: vs_build
  condition: succeeded()
  pool: Hosted
  timeoutInMinutes: 240
  strategy:
    parallel: 10
  steps:
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
        cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
      }
    displayName: 'Mount test-cache'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: DownloadPipelineArtifact@0
    displayName: 'Download Pipeline Artifact: VS test artifacts'
    inputs:
      artifactName: 'vs-artifacts'
      targetPath: '$(Build.SourcesDirectory)'
  - powershell: |
      & PortableGit\git-cmd.exe --command=usr\bin\bash.exe -lc @"
        test -f artifacts.tar.gz || {
          echo No test artifacts found\; skipping >&2
          exit 0
        }
        tar xf artifacts.tar.gz || exit 1

        # Let Git ignore the SDK and the test-cache
        printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude

        cd t &&
        PATH=\"`$PWD/helper:`$PATH\" &&
        test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
                `$(test-tool.exe path-utils slice-tests \
                        `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh)
      "@
      if (!$?) { exit(1) }
    displayName: 'Test (parallel)'
    env:
      HOME: $(Build.SourcesDirectory)
      MSYSTEM: MINGW64
      NO_SVN_TESTS: 1
      GIT_TEST_SKIP_REBASE_P: 1
  - powershell: |
      if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
        cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
      }
    displayName: 'Unmount test-cache'
    condition: true
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'vs'
      platform: Windows
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-vs-test-artifacts

- job: linux_clang
  displayName: linux-clang
  condition: succeeded()
  pool: Hosted Ubuntu 1604
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       sudo apt-get update &&
       sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&

       export CC=clang || exit 1

       ci/install-dependencies.sh || exit 1
       ci/run-build-and-tests.sh || {
           ci/print-test-failures.sh
           exit 1
       }

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
    displayName: 'ci/run-build-and-tests.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'linux-clang'
      platform: Linux
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: linux_gcc
  displayName: linux-gcc
  condition: succeeded()
  pool: Hosted Ubuntu 1604
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
       sudo apt-get update &&
       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

       ci/install-dependencies.sh || exit 1
       ci/run-build-and-tests.sh || {
           ci/print-test-failures.sh
           exit 1
       }

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
    displayName: 'ci/run-build-and-tests.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'linux-gcc'
      platform: Linux
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: osx_clang
  displayName: osx-clang
  condition: succeeded()
  pool: Hosted macOS
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       export CC=clang

       ci/install-dependencies.sh || exit 1
       ci/run-build-and-tests.sh || {
           ci/print-test-failures.sh
           exit 1
       }

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
    displayName: 'ci/run-build-and-tests.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'osx-clang'
      platform: macOS
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: osx_gcc
  displayName: osx-gcc
  condition: succeeded()
  pool: Hosted macOS
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       ci/install-dependencies.sh || exit 1
       ci/run-build-and-tests.sh || {
           ci/print-test-failures.sh
           exit 1
       }

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
    displayName: 'ci/run-build-and-tests.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'osx-gcc'
      platform: macOS
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: gettext_poison
  displayName: GETTEXT_POISON
  condition: succeeded()
  pool: Hosted Ubuntu 1604
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       sudo apt-get update &&
       sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev &&

       export jobname=GETTEXT_POISON || exit 1

       ci/run-build-and-tests.sh || {
           ci/print-test-failures.sh
           exit 1
       }

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
    displayName: 'ci/run-build-and-tests.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'gettext-poison'
      platform: Linux
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: linux32
  displayName: Linux32
  condition: succeeded()
  pool: Hosted Ubuntu 1604
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       res=0
       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

       sudo chmod a+r t/out/TEST-*.xml
       test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || res=1
       exit $res
    displayName: 'ci/run-linux32-docker.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)
  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    inputs:
      mergeTestResults: true
      testRunTitle: 'linux32'
      platform: Linux
      publishRunAttachments: false
    condition: succeededOrFailed()
  - task: PublishBuildArtifacts@1
    displayName: 'Publish trash directories of failed tests'
    condition: failed()
    inputs:
      PathtoPublish: t/failed-test-artifacts
      ArtifactName: failed-test-artifacts

- job: static_analysis
  displayName: StaticAnalysis
  condition: succeeded()
  pool: Hosted Ubuntu 1604
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       sudo apt-get update &&
       sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext &&

       export jobname=StaticAnalysis &&

       ci/run-static-analysis.sh || exit 1

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
    displayName: 'ci/run-static-analysis.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)

- job: documentation
  displayName: Documentation
  condition: succeeded()
  pool: Hosted Ubuntu 1604
  steps:
  - bash: |
       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

       sudo apt-get update &&
       sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns &&

       export ALREADY_HAVE_ASCIIDOCTOR=yes. &&
       export jobname=Documentation &&

       ci/test-documentation.sh || exit 1

       test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
    displayName: 'ci/test-documentation.sh'
    env:
      GITFILESHAREPWD: $(gitfileshare.pwd)