[PATCH i-g-t 4/4] ci: Add dependencies between jobs

Petri Latvala petri.latvala at intel.com
Fri Jan 20 15:28:39 UTC 2023


From: Tomeu Vizoso <tomeu.vizoso at collabora.com>

So a stage doesn't need to completely finish before jobs from the next
stages can start. This allows for pipelines to finish much sooner.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---
 .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f6b51b35..aa860923 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -72,6 +72,8 @@ build:tests-fedora:
     paths:
       - build
       - installdir
+  needs:
+    - build-containers:build-fedora
 
 build:tests-fedora-no-libunwind:
   stage: build
@@ -79,6 +81,8 @@ build:tests-fedora-no-libunwind:
     - dnf remove -y libunwind-devel
     - meson -Dlibunwind=disabled build
     - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
+  needs:
+    - build-containers:build-fedora
 
 # documentation building is different with meson<0.47
 build:tests-fedora-oldest-meson:
@@ -89,6 +93,8 @@ build:tests-fedora-oldest-meson:
     - meson $MESON_OPTIONS build
     - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
     - ninja -C build -j${FDO_CI_CONCURRENT:-4} igt-gpu-tools-doc
+  needs:
+    - build-containers:build-fedora
 
 # ensure igt_nouveau stubs build when nouveau support for libdrm is disabled
 build:tests-fedora-no-libdrm-nouveau:
@@ -96,6 +102,8 @@ build:tests-fedora-no-libdrm-nouveau:
   script:
     - meson -Dlibdrm_drivers= build
     - ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
+  needs:
+    - build-containers:build-fedora
 
 build:tests-fedora-clang:
   stage: build
@@ -107,6 +115,8 @@ build:tests-fedora-clang:
   artifacts:
     paths:
       - build
+  needs:
+    - build-containers:build-fedora
 
 build:tests-debian-meson:
   image: $CI_REGISTRY/$CI_PROJECT_PATH/build-debian:commit-$CI_COMMIT_SHA
@@ -118,6 +128,8 @@ build:tests-debian-meson:
   artifacts:
     paths:
       - meson-test-list.txt
+  needs:
+    - build-containers:build-debian
 
 build:tests-debian-minimal:
   image: $CI_REGISTRY/$CI_PROJECT_PATH/build-debian-minimal:commit-$CI_COMMIT_SHA
@@ -128,6 +140,8 @@ build:tests-debian-minimal:
   artifacts:
     paths:
       - build
+  needs:
+    - build-containers:build-debian
 
 build:tests-debian-meson-armhf:
   image: $CI_REGISTRY/$CI_PROJECT_PATH/build-debian-armhf:commit-$CI_COMMIT_SHA
@@ -139,6 +153,8 @@ build:tests-debian-meson-armhf:
   artifacts:
     paths:
       - build
+  needs:
+    - build-containers:build-debian-armhf
 
 build:tests-debian-meson-arm64:
   image: $CI_REGISTRY/$CI_PROJECT_PATH/build-debian-arm64:commit-$CI_COMMIT_SHA
@@ -150,6 +166,8 @@ build:tests-debian-meson-arm64:
   artifacts:
     paths:
       - build
+  needs:
+    - build-containers:build-debian-arm64
 
 #################### TEST ##########################
 
@@ -161,6 +179,8 @@ test:ninja-test:
     - build:tests-fedora
   stage: test
   script: meson test -C build --num-processes ${FDO_CI_CONCURRENT:-4}
+  needs:
+    - build:tests-fedora
 
 test:ninja-test-clang:
   tags:
@@ -172,6 +192,8 @@ test:ninja-test-clang:
     CC: clang
   stage: test
   script: meson test -C build --num-processes ${FDO_CI_CONCURRENT:-4}
+  needs:
+    - build:tests-fedora-clang
 
 test:ninja-test-minimal:
   tags:
@@ -182,6 +204,8 @@ test:ninja-test-minimal:
     - build:tests-debian-minimal
   stage: test
   script: meson test -C build --num-processes ${FDO_CI_CONCURRENT:-4}
+  needs:
+    - build:tests-debian-minimal
 
 # arm testing temporarily disabled until converted to run on native arm HW
 # test:ninja-test-arm64:
@@ -226,12 +250,16 @@ test:list-undocumented-tests:
   artifacts:
     paths:
       - undocumented_tests.txt
+  needs:
+    - build:tests-fedora
 
 test:verify-blacklists:
   dependencies:
     - build:tests-fedora
   stage: test
   script: for bl in tests/intel-ci/blacklist{,-pre-merge}.txt; do scripts/verify-blacklist.sh build/runner/igt_runner build/tests "$bl" || exit 1; done
+  needs:
+    - build:tests-fedora
 
 ################### DEPLOY #########################
 
-- 
2.30.2



More information about the Intel-gfx-trybot mailing list