OSDN Git Service

drm_hwcomposer: Pull CI check into dedicated script
authorSean Paul <seanpaul@chromium.org>
Tue, 4 Sep 2018 19:30:29 +0000 (15:30 -0400)
committerSean Paul <seanpaul@chromium.org>
Wed, 5 Sep 2018 12:49:58 +0000 (12:49 +0000)
This will be useful for adding more functionality to it. It's not very
practical to script inside the yml.

Change-Id: I71aa6b40d282f750eb9bce65dd2cfd9e2828905b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
.gitlab-ci-checkcommit.sh [new file with mode: 0755]
.gitlab-ci.yml

diff --git a/.gitlab-ci-checkcommit.sh b/.gitlab-ci-checkcommit.sh
new file mode 100755 (executable)
index 0000000..9023410
--- /dev/null
@@ -0,0 +1,9 @@
+#! /usr/bin/env bash
+
+git fetch https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer.git
+
+git diff -U0 --no-color FETCH_HEAD...HEAD -- | clang-format-diff-5.0 -p 1 -style=file > format-fixup.patch
+if [ -s format-fixup.patch ]; then
+       cat format-fixup.patch
+       exit 1
+fi
index 24c4a0a..d0175f0 100644 (file)
@@ -7,12 +7,9 @@ before_script:
 stages:
   - style
 
-clang-format:
+checkstyle:
   stage: style
-  script:
-    - git fetch https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer.git
-    - git diff -U0 --no-color FETCH_HEAD...HEAD -- | clang-format-diff-5.0 -p 1 -style=file > format-fixup.patch
-    - if [ -s format-fixup.patch ]; then cat format-fixup.patch && exit 1; fi
+  script: "./.gitlab-ci-checkcommit.sh"
   artifacts:
     when: on_failure
     paths: