Skip to content

Commit

Permalink
Add clang-tidy to Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Feb 3, 2019
1 parent 1d0c87d commit 20349db
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
32 changes: 31 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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() } ])
}
}
}
Expand Down Expand Up @@ -106,3 +106,33 @@ 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 googletest-release-1.7.0
wget -nc https://github.com/google/googletest/archive/release-1.7.0.zip
jar -xf 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 """#!/bin/bash
source tests/ci_build/setup_cuda_path.sh
python3 tests/ci_build/tidy.py --gtest-path=${WORKSPACE}/gtest
"""
}
}

4 changes: 4 additions & 0 deletions tests/ci_build/setup_cuda_path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

0 comments on commit 20349db

Please sign in to comment.