From b0120423dab11651d864767f7467c8784e821bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Lang=C3=B3?= Date: Thu, 10 May 2018 10:42:40 +0200 Subject: [PATCH] Setup SonarQube analysis in Travis CI (#2321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com --- .travis.yml | 16 +++++++++++++++- sonar-project.properties | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 sonar-project.properties diff --git a/.travis.yml b/.travis.yml index 337941105..90a4e43e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,21 @@ matrix: - gcc-5 - gcc-5-multilib env: OPTS="--quiet --jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=undefined,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold" UBSAN_OPTIONS=print_stacktrace=1 TIMEOUT=600 - + - env: JOBNAME="SonarQube" + addons: + sonarcloud: + organization: "jerryscript-project" + token: + secure: "C1QD99nllAQndSDj4uIQPWCK0jBYrC5P0IrpdhfG7li7uvdzphUM++z3zkhYeeTJR3flw/cr8d9saYlbMjGw2eZ7AdJPFy4FJ1doBXD2amIuepaG1e829SLnJner9VA+d/8j28m7lZNtvZF5efbrS4KOicijNixmJy2PKG0K2035fs6MHLdywF8cJhyMaoRiMvYahIZEjXMvPBSgG1m4+A3PpzyN8XijwOT47cVtCLav4L21Mc7LcHsrc3LeyhtEJ+cs7Lx9WDQDwXX9iCRTA5ByqrXsS4rBV/N3lJI5M9p68Yj94Qy2OvVeCmUZ4ezwuuwkX00vBUk2f4eZx3oFAp973ekA8EGm/5qEvHVcbjHoHLbfUxsAKQHVoExXGdM5r1KeVgxLDT2FSQnBZLoxIrtGOUqFEOL4WX5YaQNoUKvYFO+CNvsMQkNg65QzLinRfqcH20KjzAsVeFwVI/j87J2VjooM8910savpw53iVBNPqmO/lG3kzFL7L2p1FeOuyEg9ANAbMhAXt3SL2srT0xni+ysg4Iwq+IkU+hkQWsvM8Voz+QJmiotFsi1Pzakcu3IOlT8lVVyn5q0z59YVDht/6if7acqkZ3X5vldeNIZYkImmYhMebScxVhzAa8AS6/81A+zJ8lW1+RWJQtP3uPM1+Dq18iFkPrCEMZwtoXI=" + script: # Travis-CI does not support SonarQube analysis for pull requests from external repositories (forks) + if [[ -n "${TRAVIS_PULL_REQUEST_SLUG}" && "${TRAVIS_PULL_REQUEST_SLUG}" == "${TRAVIS_REPO_SLUG}" ]]; + then + build-wrapper-linux-x86-64 --out-dir bw-output ./tools/build.py; + sonar-scanner; + fi + cache: + directories: + - '${HOME}/.sonar/cache' - env: JOBNAME="ESP8266 Build Test" cache: ccache install: make -f ./targets/esp8266/Makefile.travis install diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..db384bbc4 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,19 @@ +# Copyright JS Foundation and other contributors, http://js.foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +sonar.projectName=JerryScript +sonar.projectKey=jerryscript +sonar.organization=jerryscript-project +sonar.sources=jerry-core,jerry-ext,jerry-main,jerry-port +sonar.cfamily.build-wrapper-output=bw-output