|
| 1 | +variables: |
| 2 | + Agent.Source.Git.ShallowFetchDepth: 1 |
| 3 | + GIT_CONFIG_PARAMETERS: "'checkout.workers=56' 'user.name=CI' 'user.email=ci@git'" |
| 4 | + |
| 5 | +jobs: |
| 6 | +- job: windows_build |
| 7 | + displayName: Windows Build |
| 8 | + condition: succeeded() |
| 9 | + pool: |
| 10 | + vmImage: windows-latest |
| 11 | + timeoutInMinutes: 240 |
| 12 | + steps: |
| 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: | |
| 20 | + # Let Git ignore the SDK and the test-cache |
| 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 |
| 24 | + displayName: Build |
| 25 | + env: |
| 26 | + HOME: $(Build.SourcesDirectory) |
| 27 | + MSYSTEM: MINGW64 |
| 28 | + DEVELOPER: 1 |
| 29 | + 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" |
| 31 | + - task: PublishPipelineArtifact@0 |
| 32 | + displayName: 'Publish Pipeline Artifact: test artifacts' |
| 33 | + inputs: |
| 34 | + artifactName: 'windows-artifacts' |
| 35 | + targetPath: '$(Build.SourcesDirectory)\artifacts' |
| 36 | + - task: PublishPipelineArtifact@0 |
| 37 | + displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal' |
| 38 | + inputs: |
| 39 | + artifactName: 'git-sdk-64-minimal' |
| 40 | + targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal' |
| 41 | + |
| 42 | +- job: windows_test |
| 43 | + displayName: Windows Test |
| 44 | + dependsOn: windows_build |
| 45 | + condition: succeeded() |
| 46 | + pool: |
| 47 | + vmImage: windows-latest |
| 48 | + timeoutInMinutes: 240 |
| 49 | + strategy: |
| 50 | + parallel: 10 |
| 51 | + steps: |
| 52 | + - task: DownloadPipelineArtifact@0 |
| 53 | + displayName: 'Download Pipeline Artifact: test artifacts' |
| 54 | + inputs: |
| 55 | + artifactName: 'windows-artifacts' |
| 56 | + targetPath: '$(Build.SourcesDirectory)' |
| 57 | + - task: DownloadPipelineArtifact@0 |
| 58 | + displayName: 'Download Pipeline Artifact: git-sdk-64-minimal' |
| 59 | + inputs: |
| 60 | + artifactName: 'git-sdk-64-minimal' |
| 61 | + targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal' |
| 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 |
| 68 | +
|
| 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 |
| 71 | +
|
| 72 | + ci/run-test-slice.sh $SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE || { |
| 73 | + ci/print-test-failures.sh |
| 74 | + exit 1 |
| 75 | + } |
| 76 | + displayName: 'Test (parallel)' |
| 77 | + env: |
| 78 | + HOME: $(Build.SourcesDirectory) |
| 79 | + MSYSTEM: MINGW64 |
| 80 | + NO_SVN_TESTS: 1 |
| 81 | + 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" |
| 83 | + - task: PublishTestResults@2 |
| 84 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 85 | + inputs: |
| 86 | + mergeTestResults: true |
| 87 | + testRunTitle: 'windows' |
| 88 | + platform: Windows |
| 89 | + publishRunAttachments: false |
| 90 | + condition: succeededOrFailed() |
| 91 | + - task: PublishBuildArtifacts@1 |
| 92 | + displayName: 'Publish trash directories of failed tests' |
| 93 | + condition: failed() |
| 94 | + inputs: |
| 95 | + PathtoPublish: t/failed-test-artifacts |
| 96 | + ArtifactName: failed-test-artifacts |
| 97 | + |
| 98 | +- job: vs_build |
| 99 | + displayName: Visual Studio Build |
| 100 | + condition: succeeded() |
| 101 | + pool: |
| 102 | + vmImage: windows-latest |
| 103 | + timeoutInMinutes: 240 |
| 104 | + steps: |
| 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: | |
| 112 | + # Let Git ignore the SDK and the test-cache |
| 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 |
| 116 | + displayName: Generate Visual Studio Solution |
| 117 | + env: |
| 118 | + HOME: $(Build.SourcesDirectory) |
| 119 | + MSYSTEM: MINGW64 |
| 120 | + DEVELOPER: 1 |
| 121 | + NO_PERL: 1 |
| 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" |
| 123 | + - powershell: | |
| 124 | + $urlbase = "https://dev.azure.com/git/git/_apis/build/builds" |
| 125 | + $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id |
| 126 | + $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl |
| 127 | + (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip") |
| 128 | + Expand-Archive compat.zip -DestinationPath . -Force |
| 129 | + Remove-Item compat.zip |
| 130 | + displayName: 'Download vcpkg artifacts' |
| 131 | + - task: MSBuild@1 |
| 132 | + inputs: |
| 133 | + solution: git.sln |
| 134 | + platform: x64 |
| 135 | + configuration: Release |
| 136 | + maximumCpuCount: 4 |
| 137 | + msbuildArguments: /p:PlatformToolset=v142 |
| 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)" |
| 142 | + displayName: Bundle artifact tar |
| 143 | + env: |
| 144 | + HOME: $(Build.SourcesDirectory) |
| 145 | + MSYSTEM: MINGW64 |
| 146 | + DEVELOPER: 1 |
| 147 | + NO_PERL: 1 |
| 148 | + MSVC: 1 |
| 149 | + 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" |
| 151 | + - powershell: | |
| 152 | + $tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content |
| 153 | + $version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content |
| 154 | + $url = "https://github.com/git-for-windows/git/releases/download/${tag}/PortableGit-${version}-64-bit.7z.exe" |
| 155 | + (New-Object Net.WebClient).DownloadFile($url,"PortableGit.exe") |
| 156 | + & .\PortableGit.exe -y -oartifacts\PortableGit |
| 157 | + # Wait until it is unpacked |
| 158 | + while (-not @(Remove-Item -ErrorAction SilentlyContinue PortableGit.exe; $?)) { sleep 1 } |
| 159 | + displayName: Download & extract portable Git |
| 160 | + - task: PublishPipelineArtifact@0 |
| 161 | + displayName: 'Publish Pipeline Artifact: MSVC test artifacts' |
| 162 | + inputs: |
| 163 | + artifactName: 'vs-artifacts' |
| 164 | + targetPath: '$(Build.SourcesDirectory)\artifacts' |
| 165 | + |
| 166 | +- job: vs_test |
| 167 | + displayName: Visual Studio Test |
| 168 | + dependsOn: vs_build |
| 169 | + condition: succeeded() |
| 170 | + pool: |
| 171 | + vmImage: windows-latest |
| 172 | + timeoutInMinutes: 240 |
| 173 | + strategy: |
| 174 | + parallel: 10 |
| 175 | + steps: |
| 176 | + - task: DownloadPipelineArtifact@0 |
| 177 | + displayName: 'Download Pipeline Artifact: VS test artifacts' |
| 178 | + inputs: |
| 179 | + artifactName: 'vs-artifacts' |
| 180 | + targetPath: '$(Build.SourcesDirectory)' |
| 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 |
| 187 | +
|
| 188 | + # Let Git ignore the SDK and the test-cache |
| 189 | + printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude |
| 190 | +
|
| 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) |
| 196 | + displayName: 'Test (parallel)' |
| 197 | + env: |
| 198 | + HOME: $(Build.SourcesDirectory) |
| 199 | + MSYSTEM: MINGW64 |
| 200 | + NO_SVN_TESTS: 1 |
| 201 | + 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" |
| 203 | + - task: PublishTestResults@2 |
| 204 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 205 | + inputs: |
| 206 | + mergeTestResults: true |
| 207 | + testRunTitle: 'vs' |
| 208 | + platform: Windows |
| 209 | + publishRunAttachments: false |
| 210 | + condition: succeededOrFailed() |
| 211 | + - task: PublishBuildArtifacts@1 |
| 212 | + displayName: 'Publish trash directories of failed tests' |
| 213 | + condition: failed() |
| 214 | + inputs: |
| 215 | + PathtoPublish: t/failed-test-artifacts |
| 216 | + ArtifactName: failed-vs-test-artifacts |
| 217 | + |
| 218 | +- job: linux_clang |
| 219 | + displayName: linux-clang |
| 220 | + condition: succeeded() |
| 221 | + pool: |
| 222 | + vmImage: ubuntu-latest |
| 223 | + steps: |
| 224 | + - bash: | |
| 225 | + export CC=clang || exit 1 |
| 226 | +
|
| 227 | + ci/install-dependencies.sh || exit 1 |
| 228 | + ci/run-build-and-tests.sh || { |
| 229 | + ci/print-test-failures.sh |
| 230 | + exit 1 |
| 231 | + } |
| 232 | + displayName: 'ci/run-build-and-tests.sh' |
| 233 | + - task: PublishTestResults@2 |
| 234 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 235 | + inputs: |
| 236 | + mergeTestResults: true |
| 237 | + testRunTitle: 'linux-clang' |
| 238 | + platform: Linux |
| 239 | + publishRunAttachments: false |
| 240 | + condition: succeededOrFailed() |
| 241 | + - task: PublishBuildArtifacts@1 |
| 242 | + displayName: 'Publish trash directories of failed tests' |
| 243 | + condition: failed() |
| 244 | + inputs: |
| 245 | + PathtoPublish: t/failed-test-artifacts |
| 246 | + ArtifactName: failed-test-artifacts |
| 247 | + |
| 248 | +- job: linux_gcc |
| 249 | + displayName: linux-gcc |
| 250 | + condition: succeeded() |
| 251 | + pool: |
| 252 | + vmImage: ubuntu-latest |
| 253 | + steps: |
| 254 | + - bash: | |
| 255 | + ci/install-dependencies.sh || exit 1 |
| 256 | + ci/run-build-and-tests.sh || { |
| 257 | + ci/print-test-failures.sh |
| 258 | + exit 1 |
| 259 | + } |
| 260 | + displayName: 'ci/run-build-and-tests.sh' |
| 261 | + - task: PublishTestResults@2 |
| 262 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 263 | + inputs: |
| 264 | + mergeTestResults: true |
| 265 | + testRunTitle: 'linux-gcc' |
| 266 | + platform: Linux |
| 267 | + publishRunAttachments: false |
| 268 | + condition: succeededOrFailed() |
| 269 | + - task: PublishBuildArtifacts@1 |
| 270 | + displayName: 'Publish trash directories of failed tests' |
| 271 | + condition: failed() |
| 272 | + inputs: |
| 273 | + PathtoPublish: t/failed-test-artifacts |
| 274 | + ArtifactName: failed-test-artifacts |
| 275 | + |
| 276 | +- job: osx_clang |
| 277 | + displayName: osx-clang |
| 278 | + condition: succeeded() |
| 279 | + pool: |
| 280 | + vmImage: macOS-latest |
| 281 | + steps: |
| 282 | + - bash: | |
| 283 | + export CC=clang |
| 284 | +
|
| 285 | + ci/install-dependencies.sh || exit 1 |
| 286 | + ci/run-build-and-tests.sh || { |
| 287 | + ci/print-test-failures.sh |
| 288 | + exit 1 |
| 289 | + } |
| 290 | + displayName: 'ci/run-build-and-tests.sh' |
| 291 | + - task: PublishTestResults@2 |
| 292 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 293 | + inputs: |
| 294 | + mergeTestResults: true |
| 295 | + testRunTitle: 'osx-clang' |
| 296 | + platform: macOS |
| 297 | + publishRunAttachments: false |
| 298 | + condition: succeededOrFailed() |
| 299 | + - task: PublishBuildArtifacts@1 |
| 300 | + displayName: 'Publish trash directories of failed tests' |
| 301 | + condition: failed() |
| 302 | + inputs: |
| 303 | + PathtoPublish: t/failed-test-artifacts |
| 304 | + ArtifactName: failed-test-artifacts |
| 305 | + |
| 306 | +- job: osx_gcc |
| 307 | + displayName: osx-gcc |
| 308 | + condition: succeeded() |
| 309 | + pool: |
| 310 | + vmImage: macOS-latest |
| 311 | + steps: |
| 312 | + - bash: | |
| 313 | + ci/install-dependencies.sh || exit 1 |
| 314 | + ci/run-build-and-tests.sh || { |
| 315 | + ci/print-test-failures.sh |
| 316 | + exit 1 |
| 317 | + } |
| 318 | + displayName: 'ci/run-build-and-tests.sh' |
| 319 | + - task: PublishTestResults@2 |
| 320 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 321 | + inputs: |
| 322 | + mergeTestResults: true |
| 323 | + testRunTitle: 'osx-gcc' |
| 324 | + platform: macOS |
| 325 | + publishRunAttachments: false |
| 326 | + condition: succeededOrFailed() |
| 327 | + - task: PublishBuildArtifacts@1 |
| 328 | + displayName: 'Publish trash directories of failed tests' |
| 329 | + condition: failed() |
| 330 | + inputs: |
| 331 | + PathtoPublish: t/failed-test-artifacts |
| 332 | + ArtifactName: failed-test-artifacts |
| 333 | + |
| 334 | +- job: linux32 |
| 335 | + displayName: Linux32 |
| 336 | + condition: succeeded() |
| 337 | + pool: |
| 338 | + vmImage: ubuntu-latest |
| 339 | + steps: |
| 340 | + - bash: | |
| 341 | + res=0 |
| 342 | + 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" jobname=linux32 bash -lxc ci/run-docker.sh || res=1 |
| 343 | +
|
| 344 | + sudo chmod a+r t/out/TEST-*.xml |
| 345 | + test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts |
| 346 | +
|
| 347 | + exit $res |
| 348 | + displayName: 'jobname=linux32 ci/run-docker.sh' |
| 349 | + - task: PublishTestResults@2 |
| 350 | + displayName: 'Publish Test Results **/TEST-*.xml' |
| 351 | + inputs: |
| 352 | + mergeTestResults: true |
| 353 | + testRunTitle: 'linux32' |
| 354 | + platform: Linux |
| 355 | + publishRunAttachments: false |
| 356 | + condition: succeededOrFailed() |
| 357 | + - task: PublishBuildArtifacts@1 |
| 358 | + displayName: 'Publish trash directories of failed tests' |
| 359 | + condition: failed() |
| 360 | + inputs: |
| 361 | + PathtoPublish: t/failed-test-artifacts |
| 362 | + ArtifactName: failed-test-artifacts |
| 363 | + |
| 364 | +- job: static_analysis |
| 365 | + displayName: StaticAnalysis |
| 366 | + condition: succeeded() |
| 367 | + pool: |
| 368 | + vmImage: ubuntu-22.04 |
| 369 | + steps: |
| 370 | + - bash: | |
| 371 | + sudo apt-get update && |
| 372 | + sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext && |
| 373 | +
|
| 374 | + export jobname=StaticAnalysis && |
| 375 | +
|
| 376 | + ci/run-static-analysis.sh || exit 1 |
| 377 | + displayName: 'ci/run-static-analysis.sh' |
| 378 | +
|
| 379 | +- job: documentation |
| 380 | + displayName: Documentation |
| 381 | + condition: succeeded() |
| 382 | + pool: |
| 383 | + vmImage: ubuntu-latest |
| 384 | + steps: |
| 385 | + - bash: | |
| 386 | + sudo apt-get update && |
| 387 | + sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns && |
| 388 | +
|
| 389 | + export ALREADY_HAVE_ASCIIDOCTOR=yes. && |
| 390 | + export jobname=Documentation && |
| 391 | +
|
| 392 | + ci/test-documentation.sh || exit 1 |
| 393 | + displayName: 'ci/test-documentation.sh' |
0 commit comments