Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit f341f3a

Browse files
committed
Configure Coverity Scan hook for Travis
1 parent 556afd1 commit f341f3a

File tree

6 files changed

+68
-30
lines changed

6 files changed

+68
-30
lines changed

.travis.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33

44
language: c
55

6+
env:
7+
global:
8+
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
9+
# via the "travis encrypt" command using the project repo's public key
10+
- secure: "D9NGp5DLAgV7ijJMGmI0XppO4/NR0pYVxHQatcPoFAMcWOBR+NoKSLVROfNldMauCedo6YXCJlh9xb1e3vurTFuUbl+gF+5p1Ji2cpNaTPdoC6vq2I3cJfHlTqbMA5lDQxw6TQ0h23CRQyeSr+0fFdHmpnEdvNk3uXugur8rZ40="
11+
612
os:
713
- osx
814
- linux
915

1016
before_install:
1117
- date -u
1218
- uname -a
13-
- env | sort
1419

1520
# Make sure CMake and Mono are installed
1621
install:
@@ -19,14 +24,24 @@ install:
1924

2025
# Build libgit2, LibGit2Sharp and run the tests
2126
script:
22-
- ./build.libgit2sharp.sh
27+
- if [ "${COVERITY_SCAN_BRANCH}" != "1" ]; then ./build.libgit2sharp.sh ; fi
2328

2429
# Only watch the development branch
2530
branches:
2631
only:
2732
- vNext
33+
- coverity
2834

2935
# Notify of build changes
3036
notifications:
3137
email:
3238
39+
40+
addons:
41+
coverity_scan:
42+
project:
43+
name: "libgit2/libgit2sharp"
44+
notification_email: [email protected]
45+
build_command_prepend: ./CI/travis.build.libgit2.sh
46+
build_command: ./CI/travis.build.libgit2sharp.sh
47+
branch_pattern: coverity

CI/travis.build.libgit2.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e
3+
4+
CURLOC=$(dirname "$0")
5+
6+
LIBGIT2SHA=$(cat "${CURLOC}"/../LibGit2Sharp/libgit2_hash.txt)
7+
SHORTSHA="${LIBGIT2SHA:0:7}"
8+
9+
echo "SHORTSHA=${SHORTSHA}"
10+
11+
rm -rf "${CURLOC}"/../libgit2/build
12+
mkdir "${CURLOC}"/../libgit2/build
13+
pushd "${CURLOC}"/../libgit2/build
14+
15+
cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
16+
-DTHREADSAFE:BOOL=ON \
17+
-DBUILD_CLAR:BOOL=OFF \
18+
-DUSE_SSH=OFF \
19+
-DLIBGIT2_FILENAME=git2-"$SHORTSHA" \
20+
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
21+
..
22+
cmake --build .
23+
24+
popd

CI/travis.build.libgit2sharp.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
CURLOC=$(dirname "$0")
5+
6+
# The Mono interop probing mechanism relies on absolute paths.
7+
# Below, a tad complicated way (but a cross-platform one) of
8+
# retrieving an absolute path to the libgit2 binaries.
9+
_BINPATH=$(cd "${CURLOC}"/../libgit2/build ; pwd)
10+
11+
export LD_LIBRARY_PATH="$_BINPATH":$LD_LIBRARY_PATH
12+
export DYLD_LIBRARY_PATH="$_BINPATH":$DYLD_LIBRARY_PATH
13+
14+
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}"
15+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
16+
17+
export MONO_OPTIONS=--debug
18+
19+
xbuild "${CURLOC}"/build.msbuild /t:Deploy
20+
21+
exit $?

CI/travis.linux.install.deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
set -ev
2+
set -e
33

44
sudo apt-get install cmake mono-devel mono-gmcs

CI/travis.osx.install.deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -ev
2+
set -e
33

44
MONO_VER=2.10.10
55

build.libgit2sharp.sh

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
#!/bin/bash
2+
set -e
23

3-
LIBGIT2SHA=`cat ./LibGit2Sharp/libgit2_hash.txt`
4-
SHORTSHA=${LIBGIT2SHA:0:7}
4+
CURLOC=$(dirname "$0")
55

6-
rm -rf libgit2/build
7-
mkdir libgit2/build
8-
pushd libgit2/build
9-
export _BINPATH=`pwd`
10-
11-
cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
12-
-DTHREADSAFE:BOOL=ON \
13-
-DBUILD_CLAR:BOOL=OFF \
14-
-DUSE_SSH=OFF \
15-
-DLIBGIT2_FILENAME=git2-$SHORTSHA \
16-
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
17-
..
18-
cmake --build .
19-
20-
export LD_LIBRARY_PATH=$_BINPATH:$LD_LIBRARY_PATH
21-
export DYLD_LIBRARY_PATH=$_BINPATH:$DYLD_LIBRARY_PATH
22-
23-
popd
24-
25-
export MONO_OPTIONS=--debug
26-
27-
echo $DYLD_LIBRARY_PATH
28-
echo $LD_LIBRARY_PATH
29-
xbuild CI/build.msbuild /t:Deploy
6+
"${CURLOC}"/CI/travis.build.libgit2.sh
7+
"${CURLOC}"/CI/travis.build.libgit2sharp.sh
308

319
exit $?

0 commit comments

Comments
 (0)