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




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

    ci: Add commit/MR checks

 .gitlab-ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f3682ff6d..2eb7a9eef 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,11 +17,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-06-13.2'
@@ -89,6 +126,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:
@@ -97,6 +137,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:
@@ -105,6 +148,9 @@ build-fedora-container@aarch64:
   stage: prepare
   variables:
     GIT_STRATEGY: none
+  needs:
+    - check-commit-log
+    - check-merge-request
 
 build-ubuntu-container@x86_64:
   extends:
@@ -113,6 +159,9 @@ build-ubuntu-container@x86_64:
   stage: prepare
   variables:
     GIT_STRATEGY: none
+  needs:
+    - check-commit-log
+    - check-merge-request
 
 build-alpine-container@x86_64:
   extends:
@@ -121,6 +170,9 @@ build-alpine-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]