You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
source $TRAVIS_BUILD_DIR/.ci/docker-prelude.sh
export PATH=$PATH:$TRAVIS_BUILD_DIR/cov-analysis/bin
if [[ "$CC" == clang* ]]; then
echo "Coverity scan branch detected, not running with clang...exiting!"
exit 0
fi
if [ "$TRAVIS_BRANCH" != "coverity_scan" ]; then
echo "coverity.run invoked for non-coverity branch $TRAVIS_BRANCH...exiting!"
exit 1
fi
echo "Performing build with Coverity Scan"
rm -fr $TRAVIS_BUILD_DIR/cov-int
./bootstrap && ./configure && make clean
cov-build --dir $TRAVIS_BUILD_DIR/cov-int make -j $(nproc)
echo "Collecting Coverity data for submission"
rm -fr README
export AUTHOR="$(git log -1 $TRAVIS_COMMIT --pretty="%aN")"
echo "Name: $AUTHOR" >> README
echo "Email: tadeusz.struk@intel.com" >> README
echo "Project: 01org/TPM2.0-TSS" >> README
echo "Build-Version: $TRAVIS_COMMIT" >> README
echo "Description: $TRAVIS_REPO_SLUG $TRAVIS_BRANCH" >> README
echo "Submitted-by: tpm2-tss CI" >> README
rm -fr tpm2-tss-scan.tgz
tar -czf $TRAVIS_BUILD_DIR/tpm2-tss-scan.tgz README cov-int
rm -fr README cov-int