Skip to content

Commit 4c2c38e

Browse files
SibiSiddharthangitster
authored andcommitted
ci: modification of main.yml to use cmake for vs-build job
Teach .github/workflows/main.yml to use CMake for VS builds. Modified the vs-test step to match windows-test step. This speeds up the vs-test. Calling git-cmd from powershell and then calling git-bash to perform the tests slows things down(factor of about 6). So git-bash is directly called from powershell to perform the tests using prove. NOTE: Since GitHub keeps the same directory for each job (with respect to path) absolute paths are used in the bin-wrapper scripts. GitHub has switched to CMake 3.17.1 which changed the behaviour of FindCURL module. An extra definition (-DCURL_NO_CURL_CMAKE=ON) has been added to revert to the old behaviour. In the configuration phase CMake looks for the required libraries for building git (eg zlib,libiconv). So we extract the libraries before we configure. To check for ICONV_OMITS_BOM libiconv.dll needs to be in the working directory of script or path. So we copy the dlls before we configure. Signed-off-by: Sibi Siddharthan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7f475e2 commit 4c2c38e

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ jobs:
145145
## Unzip and remove the artifact
146146
unzip artifacts.zip
147147
rm artifacts.zip
148-
- name: generate Visual Studio solution
149-
shell: powershell
150-
run: |
151-
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
152-
make NDEBUG=1 DEVELOPER=1 vcxproj
153-
"@
154-
if (!$?) { exit(1) }
155148
- name: download vcpkg artifacts
156149
shell: powershell
157150
run: |
@@ -163,6 +156,17 @@ jobs:
163156
Remove-Item compat.zip
164157
- name: add msbuild to PATH
165158
uses: microsoft/[email protected]
159+
- name: copy dlls to root
160+
shell: powershell
161+
run: |
162+
& compat\vcbuild\vcpkg_copy_dlls.bat release
163+
if (!$?) { exit(1) }
164+
- name: generate Visual Studio solution
165+
shell: bash
166+
run: |
167+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
168+
-DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
169+
-DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
166170
- name: MSBuild
167171
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
168172
- name: bundle artifact tar
@@ -171,8 +175,6 @@ jobs:
171175
MSVC: 1
172176
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
173177
run: |
174-
& compat\vcbuild\vcpkg_copy_dlls.bat release
175-
if (!$?) { exit(1) }
176178
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
177179
mkdir -p artifacts &&
178180
eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
@@ -203,7 +205,7 @@ jobs:
203205
- name: extract build artifacts
204206
shell: bash
205207
run: tar xf artifacts.tar.gz
206-
- name: test (parallel)
208+
- name: test
207209
shell: powershell
208210
env:
209211
MSYSTEM: MINGW64
@@ -214,12 +216,19 @@ jobs:
214216
# Let Git ignore the SDK and the test-cache
215217
printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
216218
217-
cd t &&
218-
PATH=\"`$PWD/helper:`$PATH\" &&
219-
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
220-
`$(test-tool.exe path-utils slice-tests \
221-
${{matrix.nr}} 10 t[0-9]*.sh)
219+
ci/run-test-slice.sh ${{matrix.nr}} 10
222220
"@
221+
- name: ci/print-test-failures.sh
222+
if: failure()
223+
shell: powershell
224+
run: |
225+
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
226+
- name: Upload failed tests' directories
227+
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
228+
uses: actions/upload-artifact@v1
229+
with:
230+
name: failed-tests-windows
231+
path: ${{env.FAILED_TEST_ARTIFACTS}}
223232
regular:
224233
needs: ci-config
225234
if: needs.ci-config.outputs.enabled == 'yes'

0 commit comments

Comments
 (0)