From f228ada9238b20c7d8e0af2462eec5d75e2512ae Mon Sep 17 00:00:00 2001 From: Adam Zielinski Date: Wed, 14 Aug 2024 12:29:16 +0200 Subject: [PATCH] CAPI-245(feat): analyze with sonarcloud --- .gitlab-ci.yml | 18 ++++++++++++++++++ sonar-project.properties | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 sonar-project.properties diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0d5c127..4e15942 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,3 +19,21 @@ include: - template: Code-Quality.gitlab-ci.yml - template: Security/SAST.gitlab-ci.yml - template: Security/Secret-Detection.gitlab-ci.yml + +sonarcloud-check: + variables: + SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache + GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task + image: + name: sonarsource/sonar-scanner-cli:latest + entrypoint: [""] + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + script: + - sonar-scanner + only: + - merge_requests + - master + - develop diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..113f3fa --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=anylinecom_anyline-guidance-sdk +sonar.organization=anyline + +# This is the name and version displayed in the SonarCloud UI. +sonar.projectName=Anyline Guidance SDK +#sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8