From 7d932dac22c9d03abdaf43e682c27ed762d5797d Mon Sep 17 00:00:00 2001 From: maxime Date: Sun, 17 Mar 2024 11:14:15 +0100 Subject: [PATCH] add sonar --- ci/.drone.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/.drone.yml b/ci/.drone.yml index 2555b1d..675e23a 100644 --- a/ci/.drone.yml +++ b/ci/.drone.yml @@ -6,15 +6,22 @@ name: "CI/CD" steps: - image: mcr.microsoft.com/dotnet/sdk:8.0 - name: "Run Tests" + name: "Run Tests and sonar" commands: - - dotnet test + - apt update && apt install openjdk-17-jre -y + - dotnet tool install --global dotnet-sonarscanner + - dotnet tool install --global dotnet-coverage + - export PATH="$PATH:/root/.dotnet/tools" + - dotnet sonarscanner begin /k:"IQBall-WebAPI" /d:sonar.host.url="https://codefirst.iut.uca.fr/sonar" /d:sonar.login="sqp_b16ad09dcce1b9dde920e313b10c2fe85566624c" + - dotnet build + - dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" + - dotnet sonarscanner end /d:sonar.login="sqp_b16ad09dcce1b9dde920e313b10c2fe85566624c" - image: plugins/docker name: "build and push docker image" depends_on: - - "Run Tests" + - "Run Tests and sonar" settings: dockerfile: ci/API.dockerfile context: .