From e7da6cc973cd57832fbe754d3d3a41d1cacc1873 Mon Sep 17 00:00:00 2001 From: Anthony RICHARD Date: Wed, 10 May 2023 16:13:20 +0200 Subject: [PATCH] test nouvelle pipeline --- .drone.yml | 24 ++++++------ Sources/TestPipeline/TestPipeline.sln | 37 +++++++++++++++++++ Sources/TestPipeline/TestPipeline/Program.cs | 2 + .../TestPipeline/TestPipeline.csproj | 10 +++++ Sources/TestProject1/TestGame.cs | 2 +- 5 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 Sources/TestPipeline/TestPipeline.sln create mode 100644 Sources/TestPipeline/TestPipeline/Program.cs create mode 100644 Sources/TestPipeline/TestPipeline/TestPipeline.csproj diff --git a/.drone.yml b/.drone.yml index 86da529..ad46b4c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,31 +8,31 @@ trigger: steps: - name: build - image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest + image: mcr.microsoft.com/dotnet/sdk:7.0 commands: - cd Sources/ - - dotnet restore Stim.sln - - dotnet build Stim.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 - - dotnet publish Stim/Stim.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk + - dotnet restore TestPipeline.sln + - dotnet build TestPipeline.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 + - dotnet publish Stim/TestPipeline.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk - name: tests - image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dotnet7-maui:latest + image: mcr.microsoft.com/dotnet/sdk:7.0 commands: - cd Sources/ - - dotnet restore Stim.sln - - dotnet test Stim.sln --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0 + - dotnet restore TestPipeline.sln + - dotnet test TestPipeline.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 + image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7 commands: - cd Sources/ - - dotnet restore Stim.sln + - dotnet restore TestPipeline.sln - dotnet sonarscanner begin /k:Projet_IHM /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 Stim.sln -c Release --no-restore - - dotnet test Stim.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" + - dotnet build TestPipeline.sln -c Release --no-restore + - dotnet test TestPipeline.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 Stim.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet publish TestPipeline.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: diff --git a/Sources/TestPipeline/TestPipeline.sln b/Sources/TestPipeline/TestPipeline.sln new file mode 100644 index 0000000..f2298ab --- /dev/null +++ b/Sources/TestPipeline/TestPipeline.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPipeline", "TestPipeline\TestPipeline.csproj", "{DC0B04CC-C4B6-4221-AD4A-98FEEC1A6E8C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "..\Stim.Model\Model.csproj", "{E56E9419-1E68-4C13-9301-54C4630D7A43}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "..\TestProject1\Test.csproj", "{DEF64C4E-BF42-4CDA-BE95-62DD8B01365C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DC0B04CC-C4B6-4221-AD4A-98FEEC1A6E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC0B04CC-C4B6-4221-AD4A-98FEEC1A6E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC0B04CC-C4B6-4221-AD4A-98FEEC1A6E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC0B04CC-C4B6-4221-AD4A-98FEEC1A6E8C}.Release|Any CPU.Build.0 = Release|Any CPU + {E56E9419-1E68-4C13-9301-54C4630D7A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E56E9419-1E68-4C13-9301-54C4630D7A43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E56E9419-1E68-4C13-9301-54C4630D7A43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E56E9419-1E68-4C13-9301-54C4630D7A43}.Release|Any CPU.Build.0 = Release|Any CPU + {DEF64C4E-BF42-4CDA-BE95-62DD8B01365C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DEF64C4E-BF42-4CDA-BE95-62DD8B01365C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DEF64C4E-BF42-4CDA-BE95-62DD8B01365C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DEF64C4E-BF42-4CDA-BE95-62DD8B01365C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5D28C76C-B599-49C7-8CC2-30F448740700} + EndGlobalSection +EndGlobal diff --git a/Sources/TestPipeline/TestPipeline/Program.cs b/Sources/TestPipeline/TestPipeline/Program.cs new file mode 100644 index 0000000..83fa4f4 --- /dev/null +++ b/Sources/TestPipeline/TestPipeline/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/Sources/TestPipeline/TestPipeline/TestPipeline.csproj b/Sources/TestPipeline/TestPipeline/TestPipeline.csproj new file mode 100644 index 0000000..d439800 --- /dev/null +++ b/Sources/TestPipeline/TestPipeline/TestPipeline.csproj @@ -0,0 +1,10 @@ + + + + Exe + net7.0 + enable + enable + + + diff --git a/Sources/TestProject1/TestGame.cs b/Sources/TestProject1/TestGame.cs index 36e2af8..3ee1fe3 100644 --- a/Sources/TestProject1/TestGame.cs +++ b/Sources/TestProject1/TestGame.cs @@ -42,7 +42,7 @@ namespace Test { string[] tags = { "tag 1", "tag 2", "tag 3" }; Game game = new("Nom Jeu", "Description du jeu", 2022, tags); - Review rev1 = new Review(3.5f, "Review n°1"), rev2 = new Review(3.5f, "Review n°2"), rev3 = new Review(3.5f, "Review n°3"), rev4 = new Review(3.5f, "Review n°4"); + Review rev1 = new(3.5f, "Review n°1"), rev2 = new(3.5f, "Review n°2"), rev3 = new(3.5f, "Review n°3"), rev4 = new(3.5f, "Review n°4"); game.AddReview(rev1); game.AddReview(rev2);