Skip to content

Commit 1e5983c

Browse files
committed
contrib/ci.inria.fr: add a coverity job
Will run in the extended nightly tests. Runs only on master on the main repo by default. Signed-off-by: Brice Goglin <[email protected]>
1 parent 8456668 commit 1e5983c

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

contrib/ci.inria.fr/Jenkinsfile-extended

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// + running Unix Debug checks
77
// + building MinGW Windows zipballs
88
// + running Embedded checks
9-
// + running Sonarscanner analysis
9+
// + running Coverity and Sonarscanner analysis
1010
//
1111
// The GIT checkout must use the remote branch name as the checkout local
1212
// branch name so that tarball names contain the branch name.
@@ -47,6 +47,7 @@ pipeline {
4747
dir('contrib/ci.inria.fr') {
4848
stash includes: "job-3-debug.sh", name: 'script-unix-debug'
4949
stash includes: "job-3-embedded.sh", name: 'script-embedded'
50+
stash includes: "job-3-coverity.sh", name: 'script-coverity'
5051
stash includes: "job-3-sonarscanner.sh", name: 'script-sonarscanner'
5152
stash includes: "job-3-mingw.*", name: 'scripts-mingw'
5253
stash includes: "job-3-cygwin.*", name: 'scripts-cygwin'
@@ -70,6 +71,9 @@ pipeline {
7071
if (env.NO_MINGW != 'true') {
7172
listOfNodeNames.push('MinGW')
7273
}
74+
if (env.NO_COVERITY != 'true') {
75+
listOfNodeNames.push('Coverity')
76+
}
7377
if (env.NO_SONARQUBE != 'true') {
7478
listOfNodeNames.push('SonarQube Scanner')
7579
}
@@ -103,6 +107,16 @@ pipeline {
103107
deleteDir()
104108
}
105109
}
110+
} else if (it == 'Coverity') {
111+
node('coverity') {
112+
dir('check-coverity') {
113+
unstash 'tarballgz'
114+
unstash 'script-coverity'
115+
sh 'chmod 755 job-3-coverity.sh && ./job-3-coverity.sh '+gitRepoURL+' '+gitBranch+' '+tarballgz
116+
if (env.KEEP_WORKING_DIRECTORY != 'true')
117+
deleteDir()
118+
}
119+
}
106120
} else if (it == 'SonarQube Scanner') {
107121
node('sonarscanner') {
108122
dir('check-sonarscanner') {

contrib/ci.inria.fr/job-3-coverity.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
#
3+
# Copyright © 2012-2019 Inria. All rights reserved.
4+
# See COPYING in top-level directory.
5+
#
6+
7+
echo "############################"
8+
echo "Running on:"
9+
uname -a
10+
echo "Tarball: $3"
11+
echo "############################"
12+
13+
set -e
14+
set -x
15+
16+
git_repo_url="$1"
17+
hwloc_branch="$2"
18+
tarball="$3"
19+
20+
if test -z "$git_repo_url" || test -z "$hwloc_branch"; then
21+
echo "Need repo URL and branch name as arguments."
22+
exit 1
23+
fi
24+
25+
# environment variables
26+
test -f $HOME/.ciprofile && . $HOME/.ciprofile
27+
28+
# check that the repo is the official one
29+
# check that this is master
30+
if test x$hwloc_branch != xmaster -o x$git_repo_url != xhttps://github.com/open-mpi/hwloc.git; then
31+
if test x$FORCE_COVERITY = xtrue; then
32+
echo "Forcing coverity on non-master-branch or non-official repository."
33+
else
34+
echo "Ignoring non-master-branch or non-official repository."
35+
exit 0
36+
fi
37+
fi
38+
39+
# extract the tarball
40+
basename=$(basename $tarball .tar.gz)
41+
test -d $basename && chmod -R u+rwX $basename && rm -rf $basename
42+
tar xfz $tarball
43+
rm $tarball
44+
cd $basename
45+
46+
# ignore clock problems
47+
touch configure
48+
49+
# configure things
50+
51+
VERSION=$basename
52+
COVDIR=cov-int
53+
COVBALL=myproject.tgz
54+
55+
# run
56+
./configure
57+
cov-build --dir ${COVDIR} make all
58+
cov-build --dir ${COVDIR} make check
59+
tar cfvz ${COVBALL} ${COVDIR}
60+
curl --form file=@${COVBALL} \
61+
--form "token=<${COVERITY_TOKEN_FILE}" \
62+
--form email=${EMAIL} \
63+
--form version=${VERSION} \
64+
--form description=manual \
65+
https://scan.coverity.com/builds?project=hwloc
66+
67+
exit 0

0 commit comments

Comments
 (0)