kind: pipeline name: CI type: docker trigger: event: - push steps: - name: build image: mcr.microsoft.com/dotnet/sdk:6.0 commands: - cd WF-WebAdmin/WF-WebAdmin - dotnet restore WF-WebAdmin.csproj - dotnet build WF-WebAdmin.csproj -c Release --no-restore - dotnet publish WF-WebAdmin.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/publish - name: tests image: mcr.microsoft.com/dotnet/sdk:6.0 commands: - cd WF-WebAdmin/WF-WebAdmin - dotnet restore WF-WebAdmin.csproj - dotnet test WF-WebAdmin.csproj --no-restore depends_on: [ build ] - name: code-analysis image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8 commands: - cd WF-WebAdmin/ - dotnet restore WF-WebAdmin.sln - 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} - dotnet build WF-WebAdmin.sln -c Release --no-restore - dotnet test WF-WebAdmin.sln --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 WF-WebAdmin.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release - dotnet sonarscanner end /d:sonar.login=$${sonar_token} secrets: [ SECRET_SONAR_LOGIN ] environment: sonar_host: https://codefirst.iut.uca.fr/sonar/ sonar_token: from_secret: sonar_token project_key: web_admin coverage_exclusions: "Tests/**" depends_on: [ tests ] - 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 depends_on: [ build ] - name: docker_build image: plugins/docker settings: repo: hub.codefirst.iut.uca.fr/whatthefantasy/wf-webadmin registry: hub.codefirst.iut.uca.fr dockerfile: Docker/Dockerfile tags: - latest username: from_secret: docker_username password: from_secret: docker_password depends_on: [ build, tests, code-analysis ]