[tracker-miners/wip/carlosg/ci-updates: 2/3] ci: Add commit/MR checks




commit 02f3be6be79a9b89891d33eb4642b411fecaa544
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Aug 4 15:27:53 2021 +0200

    ci: Add commit/MR checks

 .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5d142c337..c040b8eca 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,11 +16,48 @@ variables:
   TRACKER_TESTS_AWAIT_TIMEOUT: 60
 
 stages:
+  - review
   - prepare
   - build
   - test
   - analysis
 
+.check-template: &check
+  extends:
+    - .fdo.ci-fairy
+  artifacts:
+    expire_in: 1 week
+    paths:
+      - check-junit-report.xml
+    reports:
+      junit: check-junit-report.xml
+
+check-commit-log:
+  variables:
+    GIT_DEPTH: "100"
+  stage: review
+  script:
+    - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
+      then
+        ci-fairy check-commits --junit-xml=check-junit-report.xml ;
+      else
+        echo "Not a merge request" ;
+      fi
+  <<: *check
+
+check-merge-request:
+  variables:
+    GIT_STRATEGY: none
+  stage: review
+  script:
+    - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
+      then
+        ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-junit-report.xml ;
+      else
+        echo "Not a merge request" ;
+      fi
+  <<: *check
+
 .tracker-miners.fedora@common:
   variables:
     BASE_TAG: '2021-08-04.1'
@@ -88,6 +125,9 @@ build-fedora-container@x86_64:
   stage: prepare
   variables:
     GIT_STRATEGY: none
+  needs:
+    - check-commit-log
+    - check-merge-request
 
 build-fedora-rawhide-container@x86_64:
   extends:
@@ -96,6 +136,9 @@ build-fedora-rawhide-container@x86_64:
   stage: prepare
   variables:
     GIT_STRATEGY: none
+  needs:
+    - check-commit-log
+    - check-merge-request
 
 build-fedora-container@aarch64:
   extends:
@@ -104,6 +147,9 @@ build-fedora-container@aarch64:
   stage: prepare
   variables:
     GIT_STRATEGY: none
+  needs:
+    - check-commit-log
+    - check-merge-request
 
 build-ubuntu-container@x86_64:
   extends:
@@ -112,6 +158,9 @@ build-ubuntu-container@x86_64:
   stage: prepare
   variables:
     GIT_STRATEGY: none
+  needs:
+    - check-commit-log
+    - check-merge-request
 
 .build-template: &build
   stage: build


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]