From 6e79f7558d9e0b4cc4f8b9fafc1974ea84c85a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bartoletti?= Date: Thu, 1 Aug 2024 07:10:57 +0200 Subject: [PATCH] wip: fix sonar --- .gitlab/pipeline/sonar.yml | 49 ++++++-------------------------------- sonar-project.properties | 2 +- 2 files changed, 8 insertions(+), 43 deletions(-) diff --git a/.gitlab/pipeline/sonar.yml b/.gitlab/pipeline/sonar.yml index 226bec08..ca06c64f 100644 --- a/.gitlab/pipeline/sonar.yml +++ b/.gitlab/pipeline/sonar.yml @@ -6,17 +6,21 @@ variables: GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task SONAR_SCANNER_VERSION: 6.1.0.4477-linux-x64 -get-sonar-binaries: - stage: .pre +build: cache: policy: push key: "${CI_COMMIT_SHORT_SHA}" paths: - build-wrapper/ - sonar-scanner/ - script: + - bw-output/ + - build/ # the build has to be made available to the sonar-scanner for the analysis + before_script: - apt-get update -qq + - apt-get install --yes sudo wget build-essential - apt-get install --yes sudo curl wget build-essential unzip + - ./ci/debian/before_install.sh 6.0-beta1 + script: # Download sonar-scanner - curl -sSLo ./sonar-scanner.zip "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip" - unzip -o sonar-scanner.zip @@ -24,49 +28,10 @@ get-sonar-binaries: # Download build-wrapper - curl -sSLo ./build-wrapper-linux-x86.zip "${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip" - unzip -oj build-wrapper-linux-x86.zip -d ./build-wrapper - only: - - merge_requests - - master - - develop - -build: - stage: build - cache: - policy: pull-push - key: "${CI_COMMIT_SHORT_SHA}" - paths: - - build-wrapper/ - - sonar-scanner/ - - bw-output/ - - build/ # the build has to be made available to the sonar-scanner for the analysis - before_script: - - apt-get update -qq - - apt-get install --yes sudo wget build-essential - - ./ci/debian/before_install.sh 6.0-beta1 - script: # prepare the build tree - CGAL_DIR=$CI_PROJECT_DIR/CGAL cmake -S . -B build -DSFCGAL_BUILD_TESTS=ON -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ # run the build inside the build wrapper - build-wrapper/build-wrapper-linux-x86-64 --out-dir bw-output cmake --build build/ --config Release - artifacts: - paths: - - build/ - only: - - merge_requests - - master - - develop - -sonarcloud-check: - stage: .post - cache: - policy: pull - key: "${CI_COMMIT_SHORT_SHA}" - paths: - - build-wrapper/ - - sonar-scanner/ - - bw-output/ - - build/ - script: - sonar-scanner/bin/sonar-scanner -Dsonar.host.url="${SONAR_HOST_URL}" -Dsonar.token="${SONAR_TOKEN}" -Dsonar.cfamily.build-wrapper-output=bw-output only: - merge_requests diff --git a/sonar-project.properties b/sonar-project.properties index 099bb1ff..7f3ac508 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=oslandia # This is the name and version displayed in the SonarCloud UI. sonar.projectName=SFCGAL -sonar.projectVersion=1.5.2 +sonar.projectVersion=2.0.0 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. sonar.sources=src