git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] gitlab-ci: exercise Git on Windows

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 9, 2024, 13:25 UTC
Message-ID
<15b79665ac35c29d1582eebdf0c223fec358f236.1728480039.git.ps@pks.im>
In-Reply-To
<cover.1728480039.git.ps@pks.im>

Add jobs that exercise Git on Windows. Unfortunately, building and especially testing Git on Windows is inherently slower compared to other Unix-like systems, mostly because spawning processes is way slower. We thus use the same layout as we use in GitHub Actions, where we have one build job, and then pass on the resulting build artifacts to ten test jobs that split up the work across each other.

Unfortunately, the GitLab runners for Windows machines are embarassingly slow by themselves. So while this strategy leads to around 20 minutes of build time in GitHub Actions, the same pipeline takes around an hour in GitLab CI. Still, having late coverage is certainly better than having none at all.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e13e8b3866..526ecfe030 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,7 @@ default:
   timeout: 2h
 
 stages:
+  - build
   - test
   - analyze
 
@@ -108,6 +109,38 @@ test:osx:
       - t/failed-test-artifacts
     when: on_failure
 
+build:mingw64:
+  stage: build
+  tags:
+    - saas-windows-medium-amd64
+  variables:
+    NO_PERL: 1
+  before_script:
+    - ./ci/install-sdk.ps1 -directory "git-sdk"
+  script:
+    - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
+  artifacts:
+    paths:
+      - artifacts
+      - git-sdk
+
+test:mingw64:
+  stage: test
+  tags:
+    - saas-windows-medium-amd64
+  needs:
+    - job: "build:mingw64"
+      artifacts: true
+  before_script:
+    - git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
+    - New-Item -Path .git/info -ItemType Directory
+    - New-Item .git/info/exclude -ItemType File -Value "/git-sdk"
+  script:
+    - git-sdk/usr/bin/bash.exe -l -c "ci/run-test-slice.sh $CI_NODE_INDEX $CI_NODE_TOTAL"
+  after_script:
+    - git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh'
+  parallel: 10
+
 test:fuzz-smoke-tests:
   image: ubuntu:latest
   stage: test
-- 
2.47.0.rc1.33.g90fe3800b9.dirty
Previous: Patrick Steinhardt
Message 8 of 8 in “Wire up Windows-based jobs in GitLab CI”
  1. 0/5 Wire up Windows-based jobs in GitLab CIPatrick Steinhardt, Oct 9, 2024
  2. 1/5 t7300: work around platform-specific behaviour with long paths on MinGWPatrick Steinhardt, Oct 9, 2024
  3. Junio C HamanoOct 9, 2024
  4. Patrick SteinhardtOct 10, 2024
  5. 2/5 ci: create script to set up Git for Windows SDKPatrick Steinhardt, Oct 9, 2024
  6. 3/5 ci: handle Windows-based CI jobs in GitLab CIPatrick Steinhardt, Oct 9, 2024
  7. 4/5 gitlab-ci: introduce stages and dependenciesPatrick Steinhardt, Oct 9, 2024
  8. 5/5 gitlab-ci: exercise Git on WindowsPatrick Steinhardt, Oct 9, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.