diff --git a/drone.yml b/drone.yml new file mode 100644 index 0000000..073cca1 --- /dev/null +++ b/drone.yml @@ -0,0 +1,72 @@ +kind: pipeline +type: docker +name: CI-pipeline + +trigger: + branch: + - master + event: + - push + +steps: + - name: build-class + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - cd Dames/Models + - dotnet restore Models.csproj + - dotnet build Models.csproj -c Release --no-restore + + + + - name: tests + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - cd Dames/TestUnit + - dotnet restore TestUnit.csproj + - dotnet test TestUnit.csproj --no-restore + depends_on: [build-class] + + - name: build-console + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - cd Dames/Console + - dotnet restore Console.csproj + - dotnet build Console.csproj -c Release --no-restore + + - name: code-inspection + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8 + secrets: [ SECRET_SONAR_LOGIN ] + settings: + sonar_host: https://codefirst.iut.uca.fr/sonar/ + sonar_token: + from_secret: SECRET_SONAR_LOGIN + commands: + - cd Dames + - dotnet restore Models + - dotnet restore Console + - dotnet restore TestUnit + - dotnet sonarscanner begin /k:Jeu_de_dames /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="TestUnit","MauiApp1" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + - dotnet build Console -c Release --no-restore + - dotnet build TestUnit -c Release --no-restore + - dotnet build Models -c Release --no-restore + - dotnet test TestUnit --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" + - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" + - dotnet publish TestUnit -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + + + - name: generate-and-deploy-docs + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer + failure: ignore + volumes: + - name: docs + path: /docs + commands: + - /entrypoint.sh + when: + branch: + - master + event: + - push + - pull_request + depends_on: [build-class,build-console,tests]