|
|
|
@ -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: .
|
|
|
|
|