diff mbox series

[v1,1/1] travis: move code style check to separate job

Message ID 1494946807-9195-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/1] travis: move code style check to separate job | expand

Commit Message

Github ODP bot May 16, 2017, 3 p.m. UTC
From: Maxim Uvarov <maxim.uvarov@linaro.org>


Move this check to separate job to better see which exactly
task was failed.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 31 (muvarov:master_checkpatch_job)
 ** https://github.com/Linaro/odp/pull/31
 ** Patch: https://github.com/Linaro/odp/pull/31.patch
 ** Base sha: 3a8ba69bff8052cbe35dcca71ebda9b669dbf807
 ** Merge commit sha: e98ddada54058454f8ae1d2862b652cb6305138c
 **/
 .travis.yml                | 30 +++++++++++++++---------------
 scripts/ci-checkpatches.sh | 17 +++++++++++++++++
 2 files changed, 32 insertions(+), 15 deletions(-)
 create mode 100755 scripts/ci-checkpatches.sh
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index aa7ea01..1dfb444 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,12 +51,27 @@  matrix:
             - llvm-toolchain-precise-3.8
           packages:
             - clang-3.8
+    - compiler: gcc
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+          packages:
+            - gcc
+      env: TEST="CHECKPATCH"
 
 before_install:
         - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages
         - sudo mkdir -p /mnt/huge
         - sudo mount -t hugetlbfs nodev /mnt/huge
 
+        - if [  "$TEST" = "CHECKPATCH" ]; then
+            echo $TRAVIS_COMMIT_RANGE;
+            ODP_PATCHES=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.//'`;
+            ./scripts/ci-checkpatches.sh $ODP_PATCHES;
+            exit $?;
+          fi
+
         - sudo apt-get -qq update
         - sudo apt-get install automake autoconf libtool libssl-dev graphviz mscgen doxygen
         - sudo apt-get install libpcap-dev linux-headers-`uname -r`
@@ -101,21 +116,6 @@  before_install:
         - popd
 
 script:
-        - echo $TRAVIS_COMMIT_RANGE
-        - ODP_PACHES=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.//'`
-#        Generate patches provided with $TRAVIS_COMMIT_RANGE.
-#        In case of force push and range is broken validate only the latest commit if it's not merge commit.
-        - git format-patch $ODP_PACHES;
-          if [ $? -ne 0 ]; then
-            git show --summary HEAD| grep -q '^Merge:';
-            if [ $? -ne 0 ]; then
-              git format-patch HEAD^;
-              perl ./scripts/checkpatch.pl *.patch;
-            fi;
-          else
-            perl ./scripts/checkpatch.pl *.patch;
-          fi
-
         - ./bootstrap
         - ./configure
 #        doxygen does not trap on warnings, check for them here.
diff --git a/scripts/ci-checkpatches.sh b/scripts/ci-checkpatches.sh
new file mode 100755
index 0000000..533de3a
--- /dev/null
+++ b/scripts/ci-checkpatches.sh
@@ -0,0 +1,17 @@ 
+#!/bin/bash
+
+PATCHES=$1
+echo "Run checkpatch for ${PATCHES}"
+# Generate patches provided with $1.
+# In case of force push and range is broken
+# validate only the latest commit if it's not merge commit.
+git format-patch $PATCHES
+if [ $? -ne 0 ]; then
+	git show --summary HEAD| grep -q '^Merge:';
+	if [ $? -ne 0 ]; then
+		git format-patch HEAD^;
+		perl ./scripts/checkpatch.pl *.patch;
+	fi;
+else
+	perl ./scripts/checkpatch.pl *.patch;
+fi