From: Tobias Brunner Date: Mon, 10 Sep 2018 16:46:20 +0000 (+0200) Subject: travis: Add sonarcloud build X-Git-Tag: 5.7.0rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2d8833f2bb6203b35b1216d648a9db9db80e621;p=thirdparty%2Fstrongswan.git travis: Add sonarcloud build --- diff --git a/.travis.yml b/.travis.yml index 9ee06f2b37..8e36f4ebe9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ compiler: - gcc - clang +addons: + sonarcloud: + organization: "strongswan" + before_install: - travis_retry ./scripts/test.sh deps - travis_retry ./scripts/test.sh pydeps @@ -53,6 +57,10 @@ matrix: env: TEST=apidoc - compiler: gcc env: TEST=coverage + - compiler: gcc + env: TEST=sonarcloud + git: + depth: false - compiler: gcc env: TEST=win64 MONOLITHIC=yes # this does not work on 14.04 due to a missing @4 decoration for diff --git a/scripts/test.sh b/scripts/test.sh index dab45b458d..821275e6a0 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -29,7 +29,7 @@ gcrypt) printf-builtin) CONFIG="--with-printf-hooks=builtin" ;; -all|coverage) +all|coverage|sonarcloud) CONFIG="--enable-all --disable-android-dns --disable-android-log --disable-dumm --disable-kernel-pfroute --disable-keychain --disable-lock-profiler --disable-padlock --disable-fuzzing @@ -202,7 +202,16 @@ apidoc) esac echo "$ make $TARGET" -make -j4 $TARGET || exit $? +case "$TEST" in +sonarcloud) + # without target, coverage is currently not supported anyway because + # sonarqube only supports gcov, not lcov + build-wrapper-linux-x86-64 --out-dir bw-output make -j4 || exit $? + ;; +*) + make -j4 $TARGET || exit $? + ;; +esac case "$TEST" in apidoc) @@ -211,6 +220,13 @@ apidoc) exit 1 fi ;; +sonarcloud) + sonar-scanner \ + -Dsonar.projectKey=strongswan \ + -Dsonar.projectVersion=$(git describe)+${TRAVIS_BUILD_NUMBER} \ + -Dsonar.sources=. \ + -Dsonar.cfamily.build-wrapper-output=bw-output || exit $? + ;; *) ;; esac