3
fetchDepth: 1
4
5
jobs:
6
+- job: windows
7
+ displayName: Windows
8
+ condition: succeeded()
9
+ pool: Hosted
10
+ timeoutInMinutes: 240
11
+ steps:
12
+ - powershell: |
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:\
16
+ }
17
+ displayName: 'Mount test-cache'
18
+ env:
19
+ GITFILESHAREPWD: $(gitfileshare.pwd)
20
+ - powershell: |
21
+ # Helper to check the error level of the latest command (exit with error when appropriate)
22
+ function c() { if (!$?) { exit(1) } }
23
+
24
+ # Add build agent's MinGit to PATH
25
+ $env:PATH = $env:AGENT_HOMEDIRECTORY +"\externals\\git\cmd;" +$env:PATH
26
+
27
+ # Helper to initialize (or update) a Git worktree
28
+ function init ($path, $url, $set_origin) {
29
+ if (Test-Path $path) {
30
+ cd $path; c
31
+ if (Test-Path .git) {
32
+ & git init; c
33
+ } else {
34
+ & git status
35
+ }
36
+ } else {
37
+ & git init $path; c
38
+ cd $path; c
39
+ }
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
44
+ }
45
+ & git fetch --depth=1 $url master; c
46
+ & git reset --hard FETCH_HEAD; c
47
+ & git clean -df; c
48
+ }
49
+
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
53
+
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'
57
+ - powershell: |
58
+ & "git-sdk-64\git-cmd.exe" --command=usr\\bin\\bash.exe -lc @"
59
+ export DEVELOPER=1
60
+ export NO_PERL=1
61
+ export NO_SVN_TESTS=1
62
+ export GIT_TEST_SKIP_REBASE_P=1
63
+
64
+ ci/run-build-and-tests.sh || {
65
+ ci/print-test-failures.sh
66
+ exit 1
67
+ }
68
+ "@
69
+ if (!$?) { exit(1) }
70
+ displayName: 'Build & Test'
71
+ env:
72
+ HOME: $(Build.SourcesDirectory)
73
+ MSYSTEM: MINGW64
74
+ - powershell: |
75
+ if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
76
+ cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
77
+ }
78
+ displayName: 'Unmount test-cache'
79
+ condition: true
80
+ env:
81
+ GITFILESHAREPWD: $(gitfileshare.pwd)
82
+ - task: PublishTestResults@2
83
+ displayName: 'Publish Test Results **/TEST-*.xml'
84
+ inputs:
85
+ mergeTestResults: true
86
+ testRunTitle: 'windows'
87
+ platform: Windows
88
+ publishRunAttachments: false
89
+ condition: succeededOrFailed()
90
+ - task: PublishBuildArtifacts@1
91
+ displayName: 'Publish trash directories of failed tests'
92
+ condition: failed()
93
+ inputs:
94
+ PathtoPublish: t/failed-test-artifacts
95
+ ArtifactName: failed-test-artifacts
96
+
97
- job: linux_clang
98
displayName: linux-clang
99
condition: succeeded()