mapnik / node-mapnik

Bindings to mapnik for node.js
http://mapnik.org/documentation/node-mapnik
BSD 3-Clause "New" or "Revised" License
530 stars 165 forks source link

coverity scan #409

Open springmeyer opened 9 years ago

springmeyer commented 9 years ago

We should set up a branch that we can push to in order to run coverity scan occasionally on travis. I just created a "node-mapnik" project tonight: https://scan.coverity.com/projects/4362 (and invited @flippmoke as an owner).

And then downloaded the osx scan tools from https://scan.coverity.com/download?tab=cxx and pushed a first build with this script locally:

#!/usr/bin/env bash

set -eo pipefail

COVERITY_VERSION="7.6.0"

export PATH=${HOME}/cov-analysis-macosx-${COVERITY_VERSION}/bin/:$PATH

export CC=/usr/bin/clang
export CXX="/usr/bin/clang++ -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/"
rm -rf build/Release
./node_modules/.bin/node-pre-gyp configure

RESULTS_DIR="$(pwd)/cov-int"
mkdir -p $RESULTS_DIR
rm -rf $RESULTS_DIR/*
rm -f ${HOME}/cov-analysis-macosx-${COVERITY_VERSION}/config/templates/.DS_Store
rm -rf ${HOME}/cov-analysis-macosx-${COVERITY_VERSION}/config/template-clangcc-config-0
rm -rf ${HOME}/cov-analysis-macosx-${COVERITY_VERSION}/config/template-clangcxx-config-0
cov-configure --template --compiler clang --comptype clangcc
cov-build -dir $RESULTS_DIR make -C ./build/ -j1 V=1
rm -f mapnik-coverity.tgz
DESCRIBE=$(git describe)
tar czf mapnik-coverity.tgz cov-int
curl --form token=${COVERITY_TOKEN_NODE_MAPNIK} \
  --form email=dane@mapbox.com \
  --form file=@mapnik-coverity.tgz \
  --form version="${DESCRIBE}" \
  --form description="node-mapnik" \
  https://scan.coverity.com/builds?project=mapnik%2Fnode-mapnik

Next step would be to set up travis builds to push results.

flippmoke commented 9 years ago

@springmeyer part of me wonders if this is worth the complexity of doing this currently?

springmeyer commented 9 years ago

@flippmoke yes, this is worth it. Next action: @springmeyer sets up a nightly cron job to post results.