gitlab CI: move MR check to a later stage
[platform/upstream/libevdev.git] / .gitlab-ci / ci.template
index db3f835..aa7e90c 100644 (file)
@@ -24,6 +24,7 @@ stages:
   - meson            # distribution builds with meson
   - tarballs         # tarball builds
   - container_clean  # clean up unused container images
+  - merge-check      # check for a merge request
 
 variables:
   # The upstrem repository we will check for images
@@ -97,30 +98,44 @@ check-ci-script:
     - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
     - exit 1
 
+#
+# Verify that commit messages are as expected, signed-off, etc.
+#
+
 check-commit:
   image: golang:alpine
   stage: prep
   before_script:
     - apk add python3 py-pip git
+    - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
   script:
-    - pip3 install GitPython
-    - pip3 install pytest
-    - |
-      pytest --junitxml=results.xml \
-             --tb=line \
-             --assert=plain \
-             ./.gitlab-ci/check-commit.py
+    - ci-fairy check-commits --signed-off-by --junit-xml=results.xml
   except:
     - master@libevdev/libevdev
   variables:
     GIT_DEPTH: 100
   artifacts:
-    expire_in: 1 week
+    reports:
+      junit: results.xml
+
+#
+# Verify that the merge request has the allow-collaboration checkbox ticked
+#
+
+check-merge-request:
+  image: golang:alpine
+  stage: merge-check
+  before_script:
+    - apk add python3 py-pip git
+    - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
+  script:
+    - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
+  artifacts:
     when: on_failure
-    paths:
-      - results.xml
     reports:
       junit: results.xml
+  allow_failure: true
+
 
 {% for distro in distributions %}
 .{{ distro.name }}.packages: