Commit 9bf17d2c by Ben Straub

Add coverity-scan script

parent 426d8456
......@@ -13,9 +13,15 @@ env:
- OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=ON"
matrix:
fast_finish: true
include:
- compiler: i586-mingw32msvc-gcc
env: OPTIONS="-DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON"
- compiler: gcc
env: COVERITY=1
secure: "YnhS+8n6B+uoyaYfaJ3Lei7cSJqHDPiKJCKFIF2c87YDfmCvAJke8QtE7IzjYDs7UFkTCM4ox+ph2bERUrxZbSCyEkHdjIZpKuMJfYWja/jgMqTMxdyOH9y8JLFbZsSXDIXDwqBlC6vVyl1fP90M35wuWcNTs6tctfVWVofEFbs="
allow_failures:
- env: COVERITY=1
install:
- sudo apt-get -qq update
......
#!/bin/sh
if [ "$COVERITY" -eq 1 ];
then
./script/coverity.sh;
exit $?;
fi
# Create a test repo which we can use for the online::push tests
mkdir $HOME/_temp
git init --bare $HOME/_temp/test.git
......
#!/bin/bash
set -e
# Environment check
[ -z "$COVERITY_TOKEN" ] && echo "Need to set a coverity token" && exit 1
COV_VERSION=6.6.1
case `uname -m` in
i?86) BITS=32 ;;
amd64|x86_64) BITS=64 ;;
esac
SCAN_TOOL=https://scan.coverity.com/download/linux-${BITS}
TOOL_BASE=`pwd`/_coverity-scan
# Install coverity tools
if [ ! -d $TOOL_BASE ]; then
echo "Downloading coverity..."
mkdir -p $TOOL_BASE
cd $TOOL_BASE
wget -O coverity_tool.tgz $SCAN_TOOL \
--post-data "project=libgit2&token=$COVERITY_TOKEN"
tar xzf coverity_tool.tgz
cd ..
TOOL_DIR=`find $TOOL_BASE -type d -name 'cov-analysis*'`
ln -s $TOOL_DIR $TOOL_BASE/cov-analysis
fi
COV_BUILD="$TOOL_BASE/cov-analysis/bin/cov-build"
# Configure and build
rm -rf _build
mkdir _build
cd _build
cmake .. -DTHREADSAFE=ON
COVERITY_UNSUPPORTED=1 \
$COV_BUILD --dir cov-int \
cmake --build .
# Upload results
tar czf libgit2.tgz cov-int
SHA=`git rev-parse --short HEAD`
curl \
--form project=libgit2 \
--form token=$COVERITY_TOKEN \
--form email=bs@github.com \
--form file=@libgit2.tgz \
--form version=$SHA \
--form description="Travis build" \
http://scan5.coverity.com/cgi-bin/upload.py
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment