static code analysis: introduce automated scans via SonarCloud
This adds Travis and Docker configurations for automated scans, both for master branch and internal PRs. External PRs won't be checked due to security concerns (and Travis limitation related to that) - GH and SonarCloud tokens are not propagated to those. An organization and project must be created in SonarCloud for reporting, as well as a technical GH user with mraa repo commit permission, to set PR statuses in the "checks" section. Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
@@ -31,10 +31,20 @@ services:
|
||||
- CXX=${CXX:-clang++-3.8}
|
||||
- NODE_VERSION=${NODE_VERSION:-v4.4.7}
|
||||
- BUILDARCH=${BUILDARCH}
|
||||
- MRAA_SRC_DIR=${MRAA_SRC_DIR:-/usr/src/app}
|
||||
environment:
|
||||
- http_proxy
|
||||
- https_proxy
|
||||
- no_proxy
|
||||
- MRAA_SRC_DIR=/usr/src/app
|
||||
- SONAR_TOKEN
|
||||
- SONAR_ORG
|
||||
- SONAR_PROJ_KEY
|
||||
- TRAVIS_BRANCH
|
||||
- TRAVIS_PULL_REQUEST
|
||||
- TRAVIS_REPO_SLUG
|
||||
- TRAVIS_PULL_REQUEST_SLUG
|
||||
- GITHUB_TOKEN
|
||||
|
||||
doc:
|
||||
extends: main
|
||||
@@ -82,3 +92,15 @@ services:
|
||||
build:
|
||||
args:
|
||||
- NODE_VERSION=v5.12.0
|
||||
|
||||
sonar-scan:
|
||||
extends: main
|
||||
build:
|
||||
args:
|
||||
- BUILDSWIG=ON
|
||||
- BUILDSWIGPYTHON=ON
|
||||
- BUILDSWIGNODE=ON
|
||||
- BUILDSWIGJAVA=ON
|
||||
- ONEWIRE=ON
|
||||
- JSONPLAT=ON
|
||||
command: bash -c "$${MRAA_SRC_DIR}/sonar-scan.sh"
|
||||
|
||||
Reference in New Issue
Block a user