|
|
@ -27,44 +27,13 @@ steps:
|
|
|
|
- dotnet test WF-WebAdmin.csproj --no-restore
|
|
|
|
- dotnet test WF-WebAdmin.csproj --no-restore
|
|
|
|
depends_on: [build]
|
|
|
|
depends_on: [build]
|
|
|
|
|
|
|
|
|
|
|
|
- name: code-inspection
|
|
|
|
- name: analyze
|
|
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
|
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
|
|
|
secrets: [ sonar_token ]
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
|
|
|
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
|
|
|
|
|
|
|
sonar_token:
|
|
|
|
|
|
|
|
from_secret: sonar_token
|
|
|
|
|
|
|
|
project_key: wf-webadmin # Clé projet Sonar, adaptez si besoin
|
|
|
|
|
|
|
|
coverage_exclusions: 'UnitTesting/**' # Exclusions de couverture, ajustez selon vos besoins
|
|
|
|
|
|
|
|
commands:
|
|
|
|
commands:
|
|
|
|
# Restauration
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
- dotnet restore WF-WebAdmin.sln
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
|
|
|
|
- dotnet build WF-WebAdmin.csproj -c Release /p:RunAnalyzers=true
|
|
|
|
# Début de l'analyse Sonar
|
|
|
|
depends_on: [build]
|
|
|
|
- dotnet sonarscanner begin /k:$${project_key} \
|
|
|
|
|
|
|
|
/d:sonar.host.url=$${sonar_host} \
|
|
|
|
|
|
|
|
/d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" \
|
|
|
|
|
|
|
|
/d:sonar.coverage.exclusions=$${coverage_exclusions} \
|
|
|
|
|
|
|
|
/d:sonar.login=$${sonar_token}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Compilation
|
|
|
|
|
|
|
|
- dotnet build WF-WebAdmin.sln -c Release --no-restore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Test avec génération de couverture
|
|
|
|
|
|
|
|
- dotnet test WF-WebAdmin.sln --logger trx --no-restore \
|
|
|
|
|
|
|
|
/p:CollectCoverage=true \
|
|
|
|
|
|
|
|
/p:CoverletOutputFormat=cobertura \
|
|
|
|
|
|
|
|
--collect "XPlat Code Coverage"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Génération du rapport compatible SonarQube
|
|
|
|
|
|
|
|
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Publication (optionnelle) en Release, si besoin pour valider le build final
|
|
|
|
|
|
|
|
- dotnet publish WF-WebAdmin.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Fin de l'analyse Sonar
|
|
|
|
|
|
|
|
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
|
|
|
|
|
|
|
|
depends_on: [build, tests]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: docker_build
|
|
|
|
- name: docker_build
|
|
|
|