add sonar
continuous-integration/drone/push Build is passing Details

consoleTests
maxime 1 year ago
parent 4b6122f781
commit 7d932dac22

@ -6,15 +6,22 @@ name: "CI/CD"
steps: steps:
- image: mcr.microsoft.com/dotnet/sdk:8.0 - image: mcr.microsoft.com/dotnet/sdk:8.0
name: "Run Tests" name: "Run Tests and sonar"
commands: 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 - image: plugins/docker
name: "build and push docker image" name: "build and push docker image"
depends_on: depends_on:
- "Run Tests" - "Run Tests and sonar"
settings: settings:
dockerfile: ci/API.dockerfile dockerfile: ci/API.dockerfile
context: . context: .

Loading…
Cancel
Save