From 57f573cf89fa4b0453410df076f20a3b16f2d80b Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 01:58:32 +0200 Subject: [PATCH 01/12] :alembic: change std to MAUI build job --- .drone.yml | 24 ++++++++++++++++-------- MCTG/Views/Views.csproj | 4 +++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 28b413b..c3f58e0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,16 +7,24 @@ trigger: - push steps: + # - name: build + # image: mcr.microsoft.com/dotnet/sdk:7.0 + # volumes: + # - name: docs + # path: /docs + # commands: + # - cd MCTG/ + # - dotnet restore CI-CD.sln + # - dotnet build CI-CD.sln -c Release --no-restore + # - dotnet publish CI-CD.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release + - name: build - image: mcr.microsoft.com/dotnet/sdk:7.0 - volumes: - - name: docs - path: /docs + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest commands: - cd MCTG/ - - dotnet restore CI-CD.sln - - dotnet build CI-CD.sln -c Release --no-restore - - dotnet publish CI-CD.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet restore SAE-2.01.sln + - dotnet build SAE-2.01.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 + - dotnet publish Views/Views.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk - name: tests image: mcr.microsoft.com/dotnet/sdk:7.0 @@ -24,7 +32,7 @@ steps: - cd MCTG/ - dotnet restore CI-CD.sln - dotnet test CI-CD.sln --no-restore - depends_on: [build] + depends_on: [ build ] # - name: code-analysis # image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6 diff --git a/MCTG/Views/Views.csproj b/MCTG/Views/Views.csproj index d1061d8..b1615cc 100644 --- a/MCTG/Views/Views.csproj +++ b/MCTG/Views/Views.csproj @@ -1,8 +1,10 @@  - net7.0-android;net7.0-ios;net7.0-maccatalyst + net7.0-android $(TargetFrameworks);net7.0-windows10.0.19041.0 + $(TargetFrameworks);net7.0-ios + $(TargetFrameworks);net7.0-maccatalyst Exe From 186e31bc4e5fabf987c5769c987732ea22326af2 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 02:22:30 +0200 Subject: [PATCH 02/12] :alembic: add publish of console app & MAUI Unit testing --- .drone.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index c3f58e0..0636abf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,14 +24,15 @@ steps: - cd MCTG/ - dotnet restore SAE-2.01.sln - dotnet build SAE-2.01.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 + - dotnet publish MCTGApp/MCTGApp.csproj -c Release --no-restore -o CI_PROJECT_DIR/build/release - dotnet publish Views/Views.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk - name: tests - image: mcr.microsoft.com/dotnet/sdk:7.0 + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest commands: - cd MCTG/ - - dotnet restore CI-CD.sln - - dotnet test CI-CD.sln --no-restore + - dotnet restore SAE-2.01.sln + - dotnet test SAE-2.01.sln --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 depends_on: [ build ] # - name: code-analysis From 3d077ed43280356bf8ee258894e5a4b4cc60ff54 Mon Sep 17 00:00:00 2001 From: Alexandre AGOSTINHO Date: Wed, 5 Apr 2023 02:41:28 +0200 Subject: [PATCH 03/12] clean unused file `CI-CD.sln` --- MCTG/CI-CD.sln | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 MCTG/CI-CD.sln diff --git a/MCTG/CI-CD.sln b/MCTG/CI-CD.sln deleted file mode 100644 index ab7e910..0000000 --- a/MCTG/CI-CD.sln +++ /dev/null @@ -1,42 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.33516.290 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MCTGApp", "MCTGApp\MCTGApp.csproj", "{666C2211-8EBB-4FC8-9484-CB93BC854153}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MCTGLib", "MCTGLib\MCTGLib.csproj", "{42FF86BD-92F9-4A32-A938-68515905378F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MCTGLib_UnitTests", "Tests\MCTGLib_UnitTests\MCTGLib_UnitTests.csproj", "{45AB746A-194B-4E43-81EB-83B06F35AA33}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{08B80CE8-A01D-4D86-8989-AF225D5DA48C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {666C2211-8EBB-4FC8-9484-CB93BC854153}.Debug|Any CPU.Build.0 = Debug|Any CPU - {666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.ActiveCfg = Release|Any CPU - {666C2211-8EBB-4FC8-9484-CB93BC854153}.Release|Any CPU.Build.0 = Release|Any CPU - {42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42FF86BD-92F9-4A32-A938-68515905378F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {42FF86BD-92F9-4A32-A938-68515905378F}.Release|Any CPU.Build.0 = Release|Any CPU - {45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {45AB746A-194B-4E43-81EB-83B06F35AA33}.Debug|Any CPU.Build.0 = Debug|Any CPU - {45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.ActiveCfg = Release|Any CPU - {45AB746A-194B-4E43-81EB-83B06F35AA33}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {45AB746A-194B-4E43-81EB-83B06F35AA33} = {08B80CE8-A01D-4D86-8989-AF225D5DA48C} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {ADEA5603-1EF6-4D43-9493-7D6D9DE7FA3F} - EndGlobalSection -EndGlobal From 86d187e268701f801a5ad9d90df881fbf3829aa9 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 11:30:30 +0200 Subject: [PATCH 04/12] :art: add exemple of code --- MCTG/MCTGApp/MCTGApp.csproj | 6 +++- MCTG/MCTGApp/Program.cs | 34 +++++++++++++++++++-- MCTG/MCTGLib/Class1.cs | 7 ----- MCTG/MCTGLib/Recipe.cs | 60 +++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 10 deletions(-) delete mode 100644 MCTG/MCTGLib/Class1.cs create mode 100644 MCTG/MCTGLib/Recipe.cs diff --git a/MCTG/MCTGApp/MCTGApp.csproj b/MCTG/MCTGApp/MCTGApp.csproj index f02677b..7517cf8 100644 --- a/MCTG/MCTGApp/MCTGApp.csproj +++ b/MCTG/MCTGApp/MCTGApp.csproj @@ -1,4 +1,4 @@ - + Exe @@ -7,4 +7,8 @@ enable + + + + diff --git a/MCTG/MCTGApp/Program.cs b/MCTG/MCTGApp/Program.cs index 3751555..c45d82d 100644 --- a/MCTG/MCTGApp/Program.cs +++ b/MCTG/MCTGApp/Program.cs @@ -1,2 +1,32 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using System; +using MCTG.Model; + + +namespace MCTG.Program; + +public static class Program +{ + public static void Main() + { + Console.WriteLine("Helle World!"); + + Recipe recipe = new Recipe( + 1, + "Cookies aux pépites de chocolat", + new List(new string[]{ + "2 pommes", + "3L de vin", + "500g de farine" + }), + "Etape 1:\n" + + "\tCouper les pommes\n" + + "Etape 2:\n" + + "\tLes disposer sur le plat et mettre le vin dessus\n" + + "Etape 3:\n" + + "\tMettez toute la farine ensuite, puis 4h32 au four.\n" + + "\nDégustez c'est prêt !" + ); + + recipe.Display(); + } +} \ No newline at end of file diff --git a/MCTG/MCTGLib/Class1.cs b/MCTG/MCTGLib/Class1.cs deleted file mode 100644 index 5b51184..0000000 --- a/MCTG/MCTGLib/Class1.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace MCTGLib -{ - public class Class1 - { - - } -} \ No newline at end of file diff --git a/MCTG/MCTGLib/Recipe.cs b/MCTG/MCTGLib/Recipe.cs new file mode 100644 index 0000000..b69d842 --- /dev/null +++ b/MCTG/MCTGLib/Recipe.cs @@ -0,0 +1,60 @@ +using System.Text; + +namespace MCTG.Model +{ + public class Recipe + { + public uint Id { get; set; } + public string Title { get; set; } + public List Ingredients { get; set; } + public string Preparation { get; set; } + + /// + /// Constructor of a Recipe. + /// + /// Identificator + /// The name of the recipe + /// A list of ingredient needed by the preparation + /// The text that explain the preparation of the recipe + public Recipe(uint id, string title, List ingredients, string preparation) + { + Id = id; + Title = title; + Ingredients = ingredients; + Preparation = preparation; + } + + /// + /// Concatenate the list of ingredients in a single string + /// + /// The list of ingredients in string format + private string ConcatIngredients() + { + StringBuilder sb = new StringBuilder(); + foreach (string str in Ingredients) sb.Append("\t- " + str + "\n"); + + return sb.ToString(); + } + + /// + /// Build a string with all elements (title, ingredients, preparation, ...) + /// + /// A string that represent the recipe + public override string ToString() + { + return $"{Title} -- id:{Id}\n\n" + + "List of ingredient:\n" + + ConcatIngredients() + "\n\n" + + "Preparation:\n" + + $"{Preparation}\n"; + } + + /// + /// Display the recipe in the console + /// + public void Display() + { + Console.WriteLine(this.ToString()); + } + } +} \ No newline at end of file From 6570512fa6fdf0def74f5d765a928278fd278f86 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 12:02:30 +0200 Subject: [PATCH 05/12] del useless ommun namespace --- MCTG/MCTGApp/Program.cs | 4 ++-- MCTG/MCTGLib/Recipe.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MCTG/MCTGApp/Program.cs b/MCTG/MCTGApp/Program.cs index c45d82d..c0760f0 100644 --- a/MCTG/MCTGApp/Program.cs +++ b/MCTG/MCTGApp/Program.cs @@ -1,8 +1,8 @@ using System; -using MCTG.Model; +using Model; -namespace MCTG.Program; +namespace Program; public static class Program { diff --git a/MCTG/MCTGLib/Recipe.cs b/MCTG/MCTGLib/Recipe.cs index b69d842..83389cd 100644 --- a/MCTG/MCTGLib/Recipe.cs +++ b/MCTG/MCTGLib/Recipe.cs @@ -1,6 +1,6 @@ using System.Text; -namespace MCTG.Model +namespace Model { public class Recipe { From 2a1e72d5e10129f60afd809dba851d351b3dbdb0 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 16:16:07 +0200 Subject: [PATCH 06/12] :green_heart: fix sonar deployment --- .drone.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0636abf..7789a7a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,25 +35,25 @@ steps: - dotnet test SAE-2.01.sln --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 depends_on: [ build ] -# - name: code-analysis -# image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6 -# commands: -# - cd MCTG/ -# - dotnet restore CI-CD.sln -# - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} -# - dotnet build CI-CD.sln -c Release --no-restore -# - dotnet test CI-CD.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 CI-CD.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release -# - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} -# secrets: [ SECRET_SONAR_LOGIN ] -# settings: -# # accessible en ligne de commande par ${PLUGIN_SONAR_HOST} -# sonar_host: https://codefirst.iut.uca.fr/sonar/ -# # accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN} -# sonar_token: -# from_secret: SECRET_SONAR_LOGIN -# depends_on: [ tests ] + - name: code-analysis + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 + commands: + - cd MCTG/ + - dotnet restore MCTGApp/MCTGApp.csproj + - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + - dotnet build MCTGApp/MCTGApp.csproj -c Release --no-restore + - dotnet test MCTGApp/MCTGApp.csproj --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 MCTGApp/MCTGApp.csproj -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + secrets: [ SECRET_SONAR_LOGIN ] + settings: + # accessible en ligne de commande par ${PLUGIN_SONAR_HOST} + sonar_host: https://codefirst.iut.uca.fr/sonar/ + # accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN} + sonar_token: + from_secret: SECRET_SONAR_LOGIN + depends_on: [ tests ] - name: generate-and-deploy-docs image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer From 6b87750bbd53c131ab379b0e3b20e724e2b1d8a0 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 16:58:46 +0200 Subject: [PATCH 07/12] :green_heart: fix CI (indentation) --- .drone.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7789a7a..70201a7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,25 +35,25 @@ steps: - dotnet test SAE-2.01.sln --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 depends_on: [ build ] - - name: code-analysis - image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 - commands: - - cd MCTG/ - - dotnet restore MCTGApp/MCTGApp.csproj - - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - - dotnet build MCTGApp/MCTGApp.csproj -c Release --no-restore - - dotnet test MCTGApp/MCTGApp.csproj --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 MCTGApp/MCTGApp.csproj -c Release --no-restore -o CI_PROJECT_DIR/build/release - - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - secrets: [ SECRET_SONAR_LOGIN ] - settings: - # accessible en ligne de commande par ${PLUGIN_SONAR_HOST} - sonar_host: https://codefirst.iut.uca.fr/sonar/ - # accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN} - sonar_token: - from_secret: SECRET_SONAR_LOGIN - depends_on: [ tests ] + - name: code-analysis + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 + commands: + - cd MCTG/ + - dotnet restore MCTGApp/MCTGApp.csproj + - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + - dotnet build MCTGApp/MCTGApp.csproj -c Release --no-restore + - dotnet test MCTGApp/MCTGApp.csproj --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 MCTGApp/MCTGApp.csproj -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + secrets: [ SECRET_SONAR_LOGIN ] + settings: + # accessible en ligne de commande par ${PLUGIN_SONAR_HOST} + sonar_host: https://codefirst.iut.uca.fr/sonar/ + # accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN} + sonar_token: + from_secret: SECRET_SONAR_LOGIN + depends_on: [ tests ] - name: generate-and-deploy-docs image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer From 4350a9c3fc362ba7d91fbcb92fbf1970365ec2c7 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 17:12:29 +0200 Subject: [PATCH 08/12] :alembic: try fix CI (sonar) --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 70201a7..71bd077 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,12 +39,12 @@ steps: image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 commands: - cd MCTG/ - - dotnet restore MCTGApp/MCTGApp.csproj + - dotnet restore SAE-2.01.sln - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - - dotnet build MCTGApp/MCTGApp.csproj -c Release --no-restore - - dotnet test MCTGApp/MCTGApp.csproj --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" + - dotnet build SAE-2.01.sln -c Release --no-restore + - dotnet test SAE-2.01.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 MCTGApp/MCTGApp.csproj -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet publish SAE-2.01.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} secrets: [ SECRET_SONAR_LOGIN ] settings: From e76f9271c6051164c995f01f70b7ba2c87c75dca Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 17:25:52 +0200 Subject: [PATCH 09/12] :alembic: try fix CI 2 (sonar) --- .drone.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 71bd077..81bd90e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,12 +39,15 @@ steps: image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 commands: - cd MCTG/ - - dotnet restore SAE-2.01.sln + - cp SAE-2.01.sln CI.sln + - sed -i '10,11d' CI.sln + - sed -i '30,35d' CI.sln + - dotnet restore CI.sln - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - - dotnet build SAE-2.01.sln -c Release --no-restore - - dotnet test SAE-2.01.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" + - dotnet build CI.sln -c Release --no-restore + - dotnet test CI.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 SAE-2.01.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet publish CI.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} secrets: [ SECRET_SONAR_LOGIN ] settings: From 81fd9220a5e3df45564bda98d5799ef520a29e22 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 17:43:44 +0200 Subject: [PATCH 10/12] :alembic: try fix CI 3 (sonar) --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 81bd90e..b20f71b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -40,8 +40,8 @@ steps: commands: - cd MCTG/ - cp SAE-2.01.sln CI.sln - - sed -i '10,11d' CI.sln - sed -i '30,35d' CI.sln + - sed -i '10,11d' CI.sln - dotnet restore CI.sln - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - dotnet build CI.sln -c Release --no-restore From 5fff4456bbc9f1a45d63edf326aa210379712b82 Mon Sep 17 00:00:00 2001 From: Alexandre Agostinho Date: Wed, 5 Apr 2023 17:51:27 +0200 Subject: [PATCH 11/12] :green_heart: final fix CI (sonar) --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b20f71b..7bf0bdd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,7 +43,7 @@ steps: - sed -i '30,35d' CI.sln - sed -i '10,11d' CI.sln - dotnet restore CI.sln - - dotnet sonarscanner begin /k:gitrepotest /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} + - dotnet sonarscanner begin /k:SAE-2.01 /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - dotnet build CI.sln -c Release --no-restore - dotnet test CI.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" From 890ee8cb4cdc9b102946af9c228b0a4d93b3cc71 Mon Sep 17 00:00:00 2001 From: Alexandre AGOSTINHO Date: Wed, 5 Apr 2023 18:02:39 +0200 Subject: [PATCH 12/12] :speech_balloon: add sonar bages --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 17eb66f..b3889c6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -[![Build Status](https://codefirst.iut.uca.fr/api/badges/alexandre.agostinho/SAE-2.01/status.svg)](https://codefirst.iut.uca.fr/alexandre.agostinho/SAE-2.01) - -# SAE 2.01 - Développement d'une application +[![Build Status](https://codefirst.iut.uca.fr/api/badges/alexandre.agostinho/SAE-2.01/status.svg)](https://codefirst.iut.uca.fr/alexandre.agostinho/SAE-2.01) +[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=gitrepotest&metric=alert_status&token=e2b9d99abef97a250de044cc5e4b9f1d6817b67d)](https://codefirst.iut.uca.fr/sonar/dashboard?id=gitrepotest) +[![Code Smells](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=gitrepotest&metric=code_smells&token=e2b9d99abef97a250de044cc5e4b9f1d6817b67d)](https://codefirst.iut.uca.fr/sonar/dashboard?id=gitrepotest) +[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=gitrepotest&metric=coverage&token=e2b9d99abef97a250de044cc5e4b9f1d6817b67d)](https://codefirst.iut.uca.fr/sonar/dashboard?id=gitrepotest) +[![Maintainability Rating](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=gitrepotest&metric=sqale_rating&token=e2b9d99abef97a250de044cc5e4b9f1d6817b67d)](https://codefirst.iut.uca.fr/sonar/dashboard?id=gitrepotest) +[![Reliability Rating](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=gitrepotest&metric=reliability_rating&token=e2b9d99abef97a250de044cc5e4b9f1d6817b67d)](https://codefirst.iut.uca.fr/sonar/dashboard?id=gitrepotest) +[![Vulnerabilities](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=gitrepotest&metric=vulnerabilities&token=e2b9d99abef97a250de044cc5e4b9f1d6817b67d)](https://codefirst.iut.uca.fr/sonar/dashboard?id=gitrepotest) + + + +# SAE 2.01 - Développement d'une application