diff mbox series

[v3,8/8] ci: modification of main.yml to use cmake for vs-build job

Message ID bb329d16ce0999e198addf83d56f75762c830e1f.1590759624.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series CMake build system for git | expand

Commit Message

Linus Arver via GitGitGadget May 29, 2020, 1:40 p.m. UTC
From: Sibi Siddharthan <sibisiv.siddharthan@gmail.com>

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.

Edit(Explanation for the reordering of build steps):
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 <sibisiv.siddharthan@gmail.com>
---
 .github/workflows/main.yml | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)

Comments

Đoàn Trần Công Danh May 30, 2020, 2:14 p.m. UTC | #1
On 2020-05-29 13:40:24+0000, Sibi Siddharthan via GitGitGadget <gitgitgadget@gmail.com> wrote:
> 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.

If ICONV_OMITS_BOM is such a troublemaker for CMake,
I'm fine with not supporting it at all.

It seems like noone except me have interest in ICONV_OMITS_BOM.

> @@ -302,4 +308,4 @@ jobs:
>      steps:
>      - uses: actions/checkout@v1
>      - run: ci/install-dependencies.sh
> -    - run: ci/test-documentation.sh
> +    - run: ci/test-documentation.sh
> \ No newline at end of file

Please fix your editor ;)
Sibi Siddharthan May 30, 2020, 7:13 p.m. UTC | #2
On Sat, May 30, 2020 at 7:44 PM Đoàn Trần Công Danh
<congdanhqx@gmail.com> wrote:
>
> On 2020-05-29 13:40:24+0000, Sibi Siddharthan via GitGitGadget <gitgitgadget@gmail.com> wrote:
> > 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.
>
> If ICONV_OMITS_BOM is such a troublemaker for CMake,
> I'm fine with not supporting it at all.
>
> It seems like noone except me have interest in ICONV_OMITS_BOM.
>

It is not a problem supporting this check. This check has to be
implemented sometime down the road.(as it is specified in the
Makefile)
The issue currently is that this check is a bit big (~50 loc)
including setup and cleanup. This might be a burden
for the reviewers as the only reason for considering CMake support is
to support windows developers.

> > @@ -302,4 +308,4 @@ jobs:
> >      steps:
> >      - uses: actions/checkout@v1
> >      - run: ci/install-dependencies.sh
> > -    - run: ci/test-documentation.sh
> > +    - run: ci/test-documentation.sh
> > \ No newline at end of file
>
> Please fix your editor ;)
>
> --
> Danh
diff mbox series

Patch

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 84a5dcff7a0..f0f0af720e4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -145,13 +145,6 @@  jobs:
         ## Unzip and remove the artifact
         unzip artifacts.zip
         rm artifacts.zip
-    - name: generate Visual Studio solution
-      shell: powershell
-      run: |
-        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
-          make NDEBUG=1 DEVELOPER=1 vcxproj
-        "@
-        if (!$?) { exit(1) }
     - name: download vcpkg artifacts
       shell: powershell
       run: |
@@ -163,6 +156,14 @@  jobs:
         Remove-Item compat.zip
     - name: add msbuild to PATH
       uses: microsoft/setup-msbuild@v1.0.0
+    - name: copy dlls to root
+      shell: powershell
+      run: |
+        & compat\vcbuild\vcpkg_copy_dlls.bat release
+        if (!$?) { exit(1) }
+    - name: generate Visual Studio solution
+      shell: bash
+      run: cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows -DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -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
@@ -171,8 +172,6 @@  jobs:
         MSVC: 1
         VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
       run: |
-        & compat\vcbuild\vcpkg_copy_dlls.bat release
-        if (!$?) { exit(1) }
         & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
           mkdir -p artifacts &&
           eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
@@ -203,7 +202,7 @@  jobs:
     - name: extract build artifacts
       shell: bash
       run: tar xf artifacts.tar.gz
-    - name: test (parallel)
+    - name: test
       shell: powershell
       env:
         MSYSTEM: MINGW64
@@ -214,12 +213,19 @@  jobs:
           # Let Git ignore the SDK and the test-cache
           printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
 
-          cd t &&
-          PATH=\"`$PWD/helper:`$PATH\" &&
-          test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
-                  `$(test-tool.exe path-utils slice-tests \
-                          ${{matrix.nr}} 10 t[0-9]*.sh)
+          ci/run-test-slice.sh ${{matrix.nr}} 10
         "@
+    - name: ci/print-test-failures.sh
+      if: failure()
+      shell: powershell
+      run: |
+        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
+    - name: Upload failed tests' directories
+      if: failure() && env.FAILED_TEST_ARTIFACTS != ''
+      uses: actions/upload-artifact@v1
+      with:
+        name: failed-tests-windows
+        path: ${{env.FAILED_TEST_ARTIFACTS}}
   regular:
     needs: ci-config
     if: needs.ci-config.outputs.enabled == 'yes'
@@ -302,4 +308,4 @@  jobs:
     steps:
     - uses: actions/checkout@v1
     - run: ci/install-dependencies.sh
-    - run: ci/test-documentation.sh
+    - run: ci/test-documentation.sh
\ No newline at end of file