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

[PATCH 4/5] gitlab-ci: introduce stages and dependencies

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

We're about to add a couple of jobs for Windows. As the Windows runners are quite slow, we will split those up across two stages: one stage to build the artifacts, and one stage that runs test slices in parallel.

Introduce stages and "needs" dependencies for the preexisting jobs as a preparatory step. The stages will lead to a more natural representation of jobs in the UI, whereas the "needs" dependency ensures that jobs do not have to wait for all jobs in the preceding stage to finish.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 .gitlab-ci.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4abfbc3e20..e13e8b3866 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,10 @@
 default:
   timeout: 2h
 
+stages:
+  - test
+  - analyze
+
 workflow:
   rules:
     - if: $CI_PIPELINE_SOURCE == "merge_request_event"
@@ -9,6 +13,8 @@ workflow:
 
 test:linux:
   image: $image
+  stage: test
+  needs: [ ]
   tags:
     - saas-linux-medium-amd64
   variables:
@@ -67,6 +73,8 @@ test:linux:
 
 test:osx:
   image: $image
+  stage: test
+  needs: [ ]
   tags:
     - saas-macos-medium-m1
   variables:
@@ -102,6 +110,8 @@ test:osx:
 
 test:fuzz-smoke-tests:
   image: ubuntu:latest
+  stage: test
+  needs: [ ]
   variables:
     CC: clang
   before_script:
@@ -111,6 +121,8 @@ test:fuzz-smoke-tests:
 
 static-analysis:
   image: ubuntu:22.04
+  stage: analyze
+  needs: [ ]
   variables:
     jobname: StaticAnalysis
   before_script:
@@ -121,6 +133,8 @@ static-analysis:
 
 check-whitespace:
   image: ubuntu:latest
+  stage: analyze
+  needs: [ ]
   before_script:
     - ./ci/install-dependencies.sh
   # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
@@ -135,6 +149,8 @@ check-whitespace:
 
 check-style:
   image: ubuntu:latest
+  stage: analyze
+  needs: [ ]
   allow_failure: true
   variables:
     CC: clang
@@ -153,6 +169,8 @@ check-style:
 
 documentation:
   image: ubuntu:latest
+  stage: analyze
+  needs: [ ]
   variables:
     jobname: Documentation
   before_script:
-- 
2.47.0.rc1.33.g90fe3800b9.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 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.