Skip to content

Commit d28c5cf

Browse files
jamilldscho
authored andcommitted
Merge pull request #1837 from git-for-windows/azure-pipelines
Set up CI with Azure Pipelines
2 parents bd5a9f6 + 825ac15 commit d28c5cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+622
-176
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Git for Windows
22
===============
33

4-
[![Build status (Windows/macOS/Linux)](https://git-for-windows.visualstudio.com/git/_apis/build/status/12?branch=master)](https://git-for-windows.visualstudio.com/git/_build/latest?definitionId=12&branch=master)
5-
[![Build Status (core.autocrlf=true)](https://git-for-windows.visualstudio.com/_apis/public/build/definitions/f3317b6a-fa67-40d4-9a33-b652e06943df/3/badge)](https://aka.ms/git-for-windows-builds)
4+
[![Build Status (Windows/macOS/Linux)](https://dev.azure.com/git-for-windows/git/_apis/build/status/git-for-windows.git)](https://dev.azure.com/git-for-windows/git/_build/latest?definitionId=17)
5+
[![Build Status (core.autocrlf=true)](https://dev.azure.com/Git-for-Windows/git/_apis/build/status/TestWithAutoCRLF)](https://dev.azure.com/Git-for-Windows/git/_build/latest?definitionId=3)
66
[![Join the chat at https://gitter.im/git-for-windows/git](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/git-for-windows/git?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
77

88
This is [Git for Windows](http://git-for-windows.github.io/), the Windows port

azure-pipelines.yml

Lines changed: 325 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,325 @@
1+
resources:
2+
- repo: self
3+
fetchDepth: 1
4+
5+
phases:
6+
- phase: linux_clang
7+
displayName: linux-clang
8+
condition: succeeded()
9+
queue:
10+
name: Hosted Ubuntu 1604
11+
steps:
12+
- bash: |
13+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
14+
15+
sudo apt-get update &&
16+
sudo rm /var/lib/apt/lists/lock &&
17+
sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&
18+
19+
export CC=clang || exit 1
20+
21+
ci/install-dependencies.sh
22+
ci/run-build-and-tests.sh || {
23+
ci/print-test-failures.sh
24+
exit 1
25+
}
26+
27+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
28+
displayName: 'ci/run-build-and-tests.sh'
29+
env:
30+
GITFILESHAREPWD: $(gitfileshare.pwd)
31+
- task: PublishTestResults@2
32+
displayName: 'Publish Test Results **/TEST-*.xml'
33+
inputs:
34+
mergeTestResults: true
35+
testRunTitle: 'linux-clang'
36+
platform: Linux
37+
publishRunAttachments: false
38+
condition: succeededOrFailed()
39+
40+
- phase: linux_gcc
41+
displayName: linux-gcc
42+
condition: succeeded()
43+
queue:
44+
name: Hosted Ubuntu 1604
45+
steps:
46+
- bash: |
47+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
48+
49+
sudo apt-get update &&
50+
sudo rm /var/lib/apt/lists/lock &&
51+
sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin || exit 1
52+
53+
ci/install-dependencies.sh
54+
ci/run-build-and-tests.sh || {
55+
ci/print-test-failures.sh
56+
exit 1
57+
}
58+
59+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
60+
displayName: 'ci/run-build-and-tests.sh'
61+
env:
62+
GITFILESHAREPWD: $(gitfileshare.pwd)
63+
- task: PublishTestResults@2
64+
displayName: 'Publish Test Results **/TEST-*.xml'
65+
inputs:
66+
mergeTestResults: true
67+
testRunTitle: 'linux-gcc'
68+
platform: Linux
69+
publishRunAttachments: false
70+
condition: succeededOrFailed()
71+
72+
- phase: osx_clang
73+
displayName: osx-clang
74+
condition: succeeded()
75+
queue:
76+
name: Hosted macOS
77+
steps:
78+
- bash: |
79+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
80+
81+
export CC=clang
82+
83+
ci/install-dependencies.sh
84+
ci/run-build-and-tests.sh || {
85+
ci/print-test-failures.sh
86+
exit 1
87+
}
88+
89+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
90+
displayName: 'ci/run-build-and-tests.sh'
91+
env:
92+
GITFILESHAREPWD: $(gitfileshare.pwd)
93+
- task: PublishTestResults@2
94+
displayName: 'Publish Test Results **/TEST-*.xml'
95+
inputs:
96+
mergeTestResults: true
97+
testRunTitle: 'osx-clang'
98+
platform: macOS
99+
publishRunAttachments: false
100+
condition: succeededOrFailed()
101+
102+
- phase: osx_gcc
103+
displayName: osx-gcc
104+
condition: succeeded()
105+
queue:
106+
name: Hosted macOS
107+
steps:
108+
- bash: |
109+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
110+
111+
ci/install-dependencies.sh
112+
ci/run-build-and-tests.sh || {
113+
ci/print-test-failures.sh
114+
exit 1
115+
}
116+
117+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1
118+
displayName: 'ci/run-build-and-tests.sh'
119+
env:
120+
GITFILESHAREPWD: $(gitfileshare.pwd)
121+
- task: PublishTestResults@2
122+
displayName: 'Publish Test Results **/TEST-*.xml'
123+
inputs:
124+
mergeTestResults: true
125+
testRunTitle: 'osx-gcc'
126+
platform: macOS
127+
publishRunAttachments: false
128+
condition: succeededOrFailed()
129+
130+
- phase: gettext_poison
131+
displayName: GETTEXT_POISON
132+
condition: succeeded()
133+
queue:
134+
name: Hosted Ubuntu 1604
135+
steps:
136+
- bash: |
137+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
138+
139+
sudo apt-get update &&
140+
sudo rm /var/lib/apt/lists/lock &&
141+
sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev &&
142+
143+
export jobname=GETTEXT_POISON || exit 1
144+
145+
ci/run-build-and-tests.sh || {
146+
ci/print-test-failures.sh
147+
exit 1
148+
}
149+
150+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
151+
displayName: 'ci/run-build-and-tests.sh'
152+
env:
153+
GITFILESHAREPWD: $(gitfileshare.pwd)
154+
- task: PublishTestResults@2
155+
displayName: 'Publish Test Results **/TEST-*.xml'
156+
inputs:
157+
mergeTestResults: true
158+
testRunTitle: 'gettext-poison'
159+
platform: Linux
160+
publishRunAttachments: false
161+
condition: succeededOrFailed()
162+
163+
- phase: windows
164+
displayName: Windows
165+
condition: succeeded()
166+
queue:
167+
name: Hosted VS2017
168+
timeoutInMinutes: 240
169+
steps:
170+
- powershell: |
171+
# Helper to check the error level of the latest command (exit with error when appropriate)
172+
function c() { if (!$?) { exit(1) } }
173+
174+
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
175+
net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no; c
176+
cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\; c
177+
}
178+
179+
# Add build agent's MinGit to PATH
180+
$env:PATH = $env:AGENT_HOMEDIRECTORY +"\externals\\git\cmd;" +$env:PATH
181+
182+
# Helper to initialize (or update) a Git worktree
183+
function init ($path, $url, $set_origin) {
184+
if (Test-Path $path) {
185+
cd $path; c
186+
if (Test-Path .git) {
187+
git init; c
188+
} else {
189+
git status
190+
}
191+
} else {
192+
git init $path; c
193+
cd $path; c
194+
}
195+
git config core.autocrlf false; c
196+
git config core.untrackedCache true; c
197+
if (($set_origin -ne 0) -and !(git config remote.origin.url)) {
198+
git remote add origin $url; c
199+
}
200+
git fetch --depth=1 $url master; c
201+
git reset --hard FETCH_HEAD; c
202+
git clean -df; c
203+
}
204+
205+
# Initialize Git for Windows' SDK
206+
$sdk_path = "$(Build.SourcesDirectory)\git-sdk-64"
207+
init "$sdk_path" "https://dev.azure.com/git-for-windows/git-sdk-64/_git/git-sdk-64" 0
208+
init usr\src\build-extra https://github.com/git-for-windows/build-extra 1
209+
210+
cd "$(Build.SourcesDirectory)"; c
211+
212+
$env:HOME = "$(Build.SourcesDirectory)"
213+
$env:MSYSTEM = "MINGW64"
214+
git-sdk-64\git-cmd --command=usr\\bin\\bash.exe -lc @"
215+
. ci/lib.sh
216+
217+
make -j10 DEVELOPER=1 NO_PERL=1 || exit 1
218+
NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || {
219+
NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"-i -v -x\" make -k -C t failed; exit 1
220+
}
221+
222+
save_good_tree
223+
"@
224+
c
225+
226+
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
227+
cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
228+
}
229+
displayName: 'build & test'
230+
env:
231+
GITFILESHAREPWD: $(gitfileshare.pwd)
232+
- task: PublishTestResults@2
233+
displayName: 'Publish Test Results **/TEST-*.xml'
234+
inputs:
235+
mergeTestResults: true
236+
testRunTitle: 'windows'
237+
platform: Windows
238+
publishRunAttachments: false
239+
condition: succeededOrFailed()
240+
241+
- phase: linux32
242+
displayName: Linux32
243+
condition: succeeded()
244+
queue:
245+
name: Hosted Ubuntu 1604
246+
steps:
247+
- bash: |
248+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
249+
250+
sudo apt-get update &&
251+
sudo rm /var/lib/apt/lists/lock &&
252+
sudo apt-get -y install \
253+
apt-transport-https \
254+
ca-certificates \
255+
curl \
256+
software-properties-common &&
257+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&
258+
sudo add-apt-repository \
259+
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
260+
$(lsb_release -cs) \
261+
stable" &&
262+
sudo apt-get update &&
263+
sudo apt-get -y install docker-ce &&
264+
265+
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=-j3 bash -lxc ci/run-linux32-docker.sh || exit 1
266+
267+
sudo chmod a+r t/out/TEST-*.xml
268+
269+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
270+
displayName: 'ci/run-linux32-docker.sh'
271+
env:
272+
GITFILESHAREPWD: $(gitfileshare.pwd)
273+
- task: PublishTestResults@2
274+
displayName: 'Publish Test Results **/TEST-*.xml'
275+
inputs:
276+
mergeTestResults: true
277+
testRunTitle: 'linux32'
278+
platform: Linux
279+
publishRunAttachments: false
280+
condition: succeededOrFailed()
281+
282+
- phase: static_analysis
283+
displayName: StaticAnalysis
284+
condition: succeeded()
285+
queue:
286+
name: Hosted Ubuntu 1604
287+
steps:
288+
- bash: |
289+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
290+
291+
sudo apt-get update &&
292+
sudo rm /var/lib/apt/lists/lock &&
293+
sudo apt-get install -y coccinelle &&
294+
295+
export jobname=StaticAnalysis &&
296+
297+
ci/run-static-analysis.sh || exit 1
298+
299+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
300+
displayName: 'ci/run-static-analysis.sh'
301+
env:
302+
GITFILESHAREPWD: $(gitfileshare.pwd)
303+
304+
- phase: documentation
305+
displayName: Documentation
306+
condition: succeeded()
307+
queue:
308+
name: Hosted Ubuntu 1604
309+
steps:
310+
- bash: |
311+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
312+
313+
sudo apt-get update &&
314+
sudo rm /var/lib/apt/lists/lock &&
315+
sudo apt-get install -y asciidoc xmlto asciidoctor &&
316+
317+
export ALREADY_HAVE_ASCIIDOCTOR=yes. &&
318+
export jobname=Documentation &&
319+
320+
ci/test-documentation.sh || exit 1
321+
322+
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1
323+
displayName: 'ci/test-documentation.sh'
324+
env:
325+
GITFILESHAREPWD: $(gitfileshare.pwd)

ci/install-dependencies.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Install dependencies required to build and test Git on Linux and macOS
44
#
55

6-
. ${0%/*}/lib-travisci.sh
6+
. ${0%/*}/lib.sh
77

88
P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
99
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
@@ -28,7 +28,8 @@ osx-clang|osx-gcc)
2828
brew update --quiet
2929
# Uncomment this if you want to run perf tests:
3030
# brew install gnu-time
31-
brew install git-lfs gettext
31+
test -z "$BREW_INSTALL_PACKAGES" ||
32+
brew install $BREW_INSTALL_PACKAGES
3233
brew link --force gettext
3334
brew install caskroom/cask/perforce
3435
;;

0 commit comments

Comments
 (0)