From 209c598b87c30fd050ff6a14f1965098e67c8b23 Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Thu, 12 Nov 2020 17:58:55 +0100 Subject: [PATCH] .gitlab-ci.yml: add sonarqube-check part --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca34243..b2b8770 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,3 +18,24 @@ tests: - pip install biopython==1.75 script: - coverage run -m unittest discover + +sonarqube-check: + image: + name: sonarsource/sonar-scanner-cli:latest + entrypoint: [ "" ] + variables: + SONAR_TOKEN: ae2c1731888a2155e90ea0a1dcec551c8d4336bd + SONAR_HOST_URL: http://localhost:9000/ + 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 + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + script: + - sonar-scanner -Dsonar.qualitygate.wait=true + allow_failure: true + only: + - merge_requests + - master + - develop -- GitLab