Skip to content

Commit f207169

Browse files
committed
azure-pipeline: use partial clone/parallel checkout to initialize minimal-sdk
The Azure Pipeline `git-sdk-64-minimal` was retired... Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c1c15cb commit f207169

File tree

1 file changed

+55
-70
lines changed

1 file changed

+55
-70
lines changed

azure-pipelines.yml

+55-70
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
variables:
22
Agent.Source.Git.ShallowFetchDepth: 1
3+
GIT_CONFIG_PARAMETERS: "'checkout.workers=56' 'user.name=CI' 'user.email=ci@git'"
34

45
jobs:
56
- job: windows_build
@@ -9,28 +10,24 @@ jobs:
910
vmImage: windows-latest
1011
timeoutInMinutes: 240
1112
steps:
12-
- powershell: |
13-
$urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
14-
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
15-
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
16-
(New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
17-
Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
18-
Remove-Item git-sdk-64-minimal.zip
19-
13+
- bash: git clone --bare --depth=1 --filter=blob:none --single-branch -b main https://github.com/git-for-windows/git-sdk-64
14+
displayName: 'clone git-sdk-64'
15+
- bash: git clone --depth=1 --single-branch -b main https://github.com/git-for-windows/build-extra
16+
displayName: 'clone build-extra'
17+
- bash: sh -x ./build-extra/please.sh create-sdk-artifact --sdk=git-sdk-64.git --out=git-sdk-64-minimal minimal-sdk
18+
displayName: 'build git-sdk-64-minimal-sdk'
19+
- bash: |
2020
# Let Git ignore the SDK and the test-cache
21-
"/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
22-
displayName: 'Download git-sdk-64-minimal'
23-
- powershell: |
24-
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
25-
ci/make-test-artifacts.sh artifacts
26-
"@
27-
if (!$?) { exit(1) }
21+
printf "%s\n" /git-sdk-64.git/ /build-extra/ /git-sdk-64-minimal/ /test-cache/ >>'.git/info/exclude'
22+
displayName: 'Ignore untracked directories'
23+
- bash: ci/make-test-artifacts.sh artifacts
2824
displayName: Build
2925
env:
3026
HOME: $(Build.SourcesDirectory)
3127
MSYSTEM: MINGW64
3228
DEVELOPER: 1
3329
NO_PERL: 1
30+
PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem"
3431
- task: PublishPipelineArtifact@0
3532
displayName: 'Publish Pipeline Artifact: test artifacts'
3633
inputs:
@@ -62,29 +59,27 @@ jobs:
6259
inputs:
6360
artifactName: 'git-sdk-64-minimal'
6461
targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
65-
- powershell: |
66-
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
67-
test -f artifacts.tar.gz || {
68-
echo No test artifacts found\; skipping >&2
69-
exit 0
70-
}
71-
tar xf artifacts.tar.gz || exit 1
62+
- bash: |
63+
test -f artifacts.tar.gz || {
64+
echo No test artifacts found\; skipping >&2
65+
exit 0
66+
}
67+
tar xf artifacts.tar.gz || exit 1
7268
73-
# Let Git ignore the SDK and the test-cache
74-
printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
69+
# Let Git ignore the SDK and the test-cache
70+
printf '%s\n' /git-sdk-64.git/ /build-extra/ /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
7571
76-
ci/run-test-slice.sh `$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE || {
77-
ci/print-test-failures.sh
78-
exit 1
79-
}
80-
"@
81-
if (!$?) { exit(1) }
72+
ci/run-test-slice.sh $SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE || {
73+
ci/print-test-failures.sh
74+
exit 1
75+
}
8276
displayName: 'Test (parallel)'
8377
env:
8478
HOME: $(Build.SourcesDirectory)
8579
MSYSTEM: MINGW64
8680
NO_SVN_TESTS: 1
8781
GIT_TEST_SKIP_REBASE_P: 1
82+
PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin\\core_perl;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem"
8883
- task: PublishTestResults@2
8984
displayName: 'Publish Test Results **/TEST-*.xml'
9085
inputs:
@@ -107,29 +102,24 @@ jobs:
107102
vmImage: windows-latest
108103
timeoutInMinutes: 240
109104
steps:
110-
- powershell: |
111-
$urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
112-
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
113-
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
114-
(New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
115-
Expand-Archive git-sdk-64-minimal.zip -DestinationPath . -Force
116-
Remove-Item git-sdk-64-minimal.zip
117-
105+
- bash: git clone --bare --depth=1 --filter=blob:none --single-branch -b main https://github.com/git-for-windows/git-sdk-64
106+
displayName: 'clone git-sdk-64'
107+
- bash: git clone --depth=1 --single-branch -b main https://github.com/git-for-windows/build-extra
108+
displayName: 'clone build-extra'
109+
- bash: sh -x ./build-extra/please.sh create-sdk-artifact --sdk=git-sdk-64.git --out=git-sdk-64-minimal minimal-sdk
110+
displayName: 'build git-sdk-64-minimal-sdk'
111+
- bash: |
118112
# Let Git ignore the SDK and the test-cache
119-
"/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
120-
displayName: 'Download git-sdk-64-minimal'
121-
- powershell: |
122-
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
123-
make NDEBUG=1 DEVELOPER=1 vcxproj
124-
"@
125-
if (!$?) { exit(1) }
113+
printf "%s\n" /git-sdk-64-minimal/ /test-cache/ >>'.git/info/exclude'
114+
displayName: 'Ignore untracked directories'
115+
- bash: make NDEBUG=1 DEVELOPER=1 vcxproj
126116
displayName: Generate Visual Studio Solution
127117
env:
128118
HOME: $(Build.SourcesDirectory)
129119
MSYSTEM: MINGW64
130120
DEVELOPER: 1
131121
NO_PERL: 1
132-
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
122+
PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem"
133123
- powershell: |
134124
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
135125
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
@@ -145,14 +135,10 @@ jobs:
145135
configuration: Release
146136
maximumCpuCount: 4
147137
msbuildArguments: /p:PlatformToolset=v142
148-
- powershell: |
149-
& compat\vcbuild\vcpkg_copy_dlls.bat release
150-
if (!$?) { exit(1) }
151-
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
152-
mkdir -p artifacts &&
153-
eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)\"
154-
"@
155-
if (!$?) { exit(1) }
138+
- bash: |
139+
./compat/vcbuild/vcpkg_copy_dlls.bat release &&
140+
mkdir -p artifacts &&
141+
eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)"
156142
displayName: Bundle artifact tar
157143
env:
158144
HOME: $(Build.SourcesDirectory)
@@ -161,6 +147,7 @@ jobs:
161147
NO_PERL: 1
162148
MSVC: 1
163149
VCPKG_ROOT: $(Build.SourcesDirectory)\compat\vcbuild\vcpkg
150+
PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem"
164151
- powershell: |
165152
$tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content
166153
$version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content
@@ -191,30 +178,28 @@ jobs:
191178
inputs:
192179
artifactName: 'vs-artifacts'
193180
targetPath: '$(Build.SourcesDirectory)'
194-
- powershell: |
195-
& PortableGit\git-cmd.exe --command=usr\bin\bash.exe -lc @"
196-
test -f artifacts.tar.gz || {
197-
echo No test artifacts found\; skipping >&2
198-
exit 0
199-
}
200-
tar xf artifacts.tar.gz || exit 1
181+
- bash: |
182+
test -f artifacts.tar.gz || {
183+
echo No test artifacts found\; skipping >&2
184+
exit 0
185+
}
186+
tar xf artifacts.tar.gz || exit 1
201187
202-
# Let Git ignore the SDK and the test-cache
203-
printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude
188+
# Let Git ignore the SDK and the test-cache
189+
printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude
204190
205-
cd t &&
206-
PATH=\"`$PWD/helper:`$PATH\" &&
207-
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
208-
`$(test-tool.exe path-utils slice-tests \
209-
`$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh)
210-
"@
211-
if (!$?) { exit(1) }
191+
cd t &&
192+
PATH="$PWD/helper:$PATH" &&
193+
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
194+
$(test-tool.exe path-utils slice-tests \
195+
$SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh)
212196
displayName: 'Test (parallel)'
213197
env:
214198
HOME: $(Build.SourcesDirectory)
215199
MSYSTEM: MINGW64
216200
NO_SVN_TESTS: 1
217201
GIT_TEST_SKIP_REBASE_P: 1
202+
PATH: "$(Build.SourcesDirectory)\\PortableGit\\mingw64\\bin;$(Build.SourcesDirectory)\\PortableGit\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem"
218203
- task: PublishTestResults@2
219204
displayName: 'Publish Test Results **/TEST-*.xml'
220205
inputs:

0 commit comments

Comments
 (0)