From 1a7756f955f9760a2d7bd491bb1c456dbc1bf810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20LAVERGNE?= Date: Sat, 15 Jun 2024 22:21:41 +0200 Subject: [PATCH] Test on the Drone CI --- .drone.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 49c9b01..4289380 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,12 @@ trigger: - push steps: + - name: clean + image: mcr.microsoft.com/dotnet/sdk:7.0 + commands: + - cd Sources/GameAtlas + - dotnet clean GameAtlas.sln + - name: build-Models image: mcr.microsoft.com/dotnet/sdk:7.0 commands: @@ -20,13 +26,15 @@ steps: - name: build-MAUI image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest + environment: + ANDROID_SDK_ROOT: /usr/lib/android-sdk commands: - - cd Sources/GameAtlas/ + - cd Sources/GameAtlas - dotnet restore GameAtlas.sln - - dotnet build GameAtlas.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 + - dotnet build GameAtlas.sln -c Release --no-restore /v:diag /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 - name: tests - image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/sdk:7.0 commands: - cd Sources/GameAtlas/ - dotnet restore GameAtlas.sln @@ -34,7 +42,7 @@ steps: depends_on: [build-Models] - name: code-analysis - image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7-maui + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 secrets: [ SECRET_SONAR_LOGIN ] settings: # accessible en ligne de commande par ${PLUGIN_SONAR_HOST} @@ -49,7 +57,7 @@ steps: - dotnet build GameAtlas.sln -c Release --no-restore - dotnet test GameAtlas.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 GameAtlas/GameAtlas.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk + - dotnet publish GameAtlas/GameAtlas.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} depends_on: [tests]