From 155ef2db35cecbfac783b1d7bc6701f8123742f8 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Wed, 30 Jan 2019 06:32:15 +0000 Subject: [PATCH] [WIP] Add clang-tidy to Jenkins --- Jenkinsfile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 143cba5969cf..ca99675afdbf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,7 +53,7 @@ pipeline { parallel (buildMatrix.findAll{it['enabled']}.collectEntries{ c -> def buildName = utils.getBuildName(c) utils.buildFactory(buildName, c, false, this.&buildPlatformCmake) - }) + } + [ "clang-tidy" : { buildClangTidyJob() } ]) } } } @@ -106,3 +106,32 @@ def buildPlatformCmake(buildName, conf, nodeReq, dockerTarget) { } } } + +/** + * Run a clang-tidy job on a GPU machine + */ +def buildClangTidyJob() { + def nodeReq = "linux && gpu && unrestricted" + node(nodeReq) { + unstash name: 'srcs' + echo "Running clang-tidy job..." + // Install Google Test and Python yaml + sh """ + pip3 install pyyaml + + rm -rf gtest + wget -nc https://github.com/google/googletest/archive/release-1.7.0.zip + unzip -n release-1.7.0.zip + mv googletest-release-1.7.0 gtest && cd gtest + cmake . && make + mkdir lib && mv libgtest.a lib + cd .. + rm -rf release-1.7.0.zip* + """ + // Run clang-tidy job + sh """ + python3 tests/ci_build/tidy.py --gtest-path=${PWD}/gtest + """ + } + } +