TO-DROP: ci: only build vs-build, and actually build it #1821
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
env: | |
DEVELOPER: 1 | |
# If more than one workflow run is triggered for the very same commit hash | |
# (which happens when multiple branches pointing to the same commit), only | |
# the first one is allowed to run, the second will be kept in the "queued" | |
# state. This allows a successful completion of the first run to be reused | |
# in the second run via the `skip-if-redundant` logic in the `config` job. | |
# | |
# The only caveat is that if a workflow run is triggered for the same commit | |
# hash that another run is already being held, that latter run will be | |
# canceled. For more details about the `concurrency` attribute, see: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | |
concurrency: | |
group: ${{ github.sha }} | |
jobs: | |
vs-build: | |
name: win+VS build | |
env: | |
NO_PERL: 1 | |
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'" | |
runs-on: windows-latest | |
concurrency: | |
group: vs-build-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: git-for-windows/setup-git-for-windows-sdk@v1 | |
- name: initialize vcpkg | |
uses: actions/checkout@v4 | |
with: | |
repository: 'microsoft/vcpkg' | |
path: 'compat/vcbuild/vcpkg' | |
- name: download vcpkg artifacts | |
shell: powershell | |
run: | | |
$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 | |
- name: add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1 | |
- name: copy dlls to root | |
shell: cmd | |
run: compat\vcbuild\vcpkg_copy_dlls.bat release | |
- name: generate Visual Studio solution | |
shell: bash | |
run: | | |
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \ | |
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON | |
- name: MSBuild | |
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142 | |
- name: bundle artifact tar | |
shell: bash | |
env: | |
MSVC: 1 | |
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg | |
run: | | |
mkdir -p artifacts && | |
eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts NO_GETTEXT=YesPlease 2>&1 | grep ^tar)" | |
- name: zip up tracked files | |
run: git archive -o artifacts/tracked.tar.gz HEAD | |
- name: upload tracked files and build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vs-artifacts | |
path: artifacts | |
vs-test: | |
name: win+VS test | |
runs-on: windows-latest | |
needs: [vs-build] | |
strategy: | |
fail-fast: false | |
matrix: | |
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
concurrency: | |
group: vs-test-${{ matrix.nr }}-${{ github.ref }} | |
steps: | |
- uses: git-for-windows/setup-git-for-windows-sdk@v1 | |
- name: download tracked files and build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: vs-artifacts | |
path: ${{github.workspace}} | |
- name: extract tracked files and build artifacts | |
shell: bash | |
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz | |
- name: test | |
shell: bash | |
env: | |
NO_SVN_TESTS: 1 | |
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10 | |
- name: print test failures | |
if: failure() && env.FAILED_TEST_ARTIFACTS != '' | |
shell: bash | |
run: ci/print-test-failures.sh | |
- name: Upload failed tests' directories | |
if: failure() && env.FAILED_TEST_ARTIFACTS != '' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: failed-tests-windows-vs-${{ matrix.nr }} | |
path: ${{env.FAILED_TEST_ARTIFACTS}} |