Update project

pull/10/head
Louwar 2 years ago
parent 6f78a7acc9
commit e63058075d

@ -1,19 +1,66 @@
kind: pipeline kind: pipeline
name: mon_pipeline type: docker
name: default
trigger:
event:
- push
steps: steps:
- name: deploy-container-mysql - name: build
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest image: mcr.microsoft.com/dotnet/sdk:6.0
environment: volumes:
IMAGENAME: mariadb:10 - name: docs
CONTAINERNAME: mysql path: /docs
PRIVATE: true commands:
CODEFIRST_CLIENTDRONE_ENV_MARIADB_ROOT_PASSWORD: - cd Sources/
from_secret: db_root_password - dotnet restore LeagueOfLegends.sln
CODEFIRST_CLIENTDRONE_ENV_MARIADB_DATABASE: - dotnet build LeagueOfLegends.sln -c Release --no-restore
from_secret: db_database - dotnet publish LeagueOfLegends.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
CODEFIRST_CLIENTDRONE_ENV_MARIADB_USER:
from_secret: db_user - name: tests
CODEFIRST_CLIENTDRONE_ENV_MARIADB_PASSWORD: image: mcr.microsoft.com/dotnet/sdk:6.0
from_secret: db_password commands:
COMMAND: create - cd Sources/
- dotnet restore LeagueOfLegends.sln
- dotnet test LeagueOfLegends.sln --no-restore
depends_on: [build]
- name: code-analysis
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
commands:
- cd Sources/
- dotnet restore LeagueOfLegends.sln
- dotnet sonarscanner begin /k:$EntityFramework_LoL /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 LeagueOfLegends.sln -c Release --no-restore
- dotnet test LeagueOfLegends.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 LeagueOfLegends.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: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
failure: ignore
volumes:
- name: docs
path: /docs
commands:
#- cd Documentation/doxygen
#- doxygen Doxyfile
- /entrypoint.sh
when:
branch:
- master
depends_on: [ build ]
volumes:
- name: docs
temp: {}

@ -23,10 +23,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "API", "API\API.csproj", "{3
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAPI", "ConsoleAPI\ConsoleAPI.csproj", "{1BC3389F-495C-4889-8969-BD566F1512AF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAPI", "ConsoleAPI\ConsoleAPI.csproj", "{1BC3389F-495C-4889-8969-BD566F1512AF}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StubEF", "StubEF\StubEF.csproj", "{9AA1A21B-90EE-4D6C-B47B-8FDA701078EF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestEF", "TestEF\TestEF.csproj", "{84B0BF2B-17C8-403B-9A26-2310A2A368F9}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestEF", "TestEF\TestEF.csproj", "{84B0BF2B-17C8-403B-9A26-2310A2A368F9}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StubEF", "StubEF\StubEF.csproj", "{C1DC0ABC-B053-4E2F-8D9D-E283C68735E6}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -65,14 +65,14 @@ Global
{1BC3389F-495C-4889-8969-BD566F1512AF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1BC3389F-495C-4889-8969-BD566F1512AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BC3389F-495C-4889-8969-BD566F1512AF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1BC3389F-495C-4889-8969-BD566F1512AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BC3389F-495C-4889-8969-BD566F1512AF}.Release|Any CPU.Build.0 = Release|Any CPU {1BC3389F-495C-4889-8969-BD566F1512AF}.Release|Any CPU.Build.0 = Release|Any CPU
{9AA1A21B-90EE-4D6C-B47B-8FDA701078EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9AA1A21B-90EE-4D6C-B47B-8FDA701078EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9AA1A21B-90EE-4D6C-B47B-8FDA701078EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9AA1A21B-90EE-4D6C-B47B-8FDA701078EF}.Release|Any CPU.Build.0 = Release|Any CPU
{84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Debug|Any CPU.Build.0 = Debug|Any CPU {84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Release|Any CPU.ActiveCfg = Release|Any CPU {84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Release|Any CPU.Build.0 = Release|Any CPU {84B0BF2B-17C8-403B-9A26-2310A2A368F9}.Release|Any CPU.Build.0 = Release|Any CPU
{C1DC0ABC-B053-4E2F-8D9D-E283C68735E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1DC0ABC-B053-4E2F-8D9D-E283C68735E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1DC0ABC-B053-4E2F-8D9D-E283C68735E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1DC0ABC-B053-4E2F-8D9D-E283C68735E6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -80,8 +80,8 @@ Global
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{1889FA6E-B7C6-416E-8628-9449FB9070B9} = {C76D0C23-1FFA-4963-93CD-E12BD643F030} {1889FA6E-B7C6-416E-8628-9449FB9070B9} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{B01D7EF2-2D64-409A-A29A-61FB7BB7A9DB} = {2C607793-B163-4731-A4D1-AFE8A7C4C170} {B01D7EF2-2D64-409A-A29A-61FB7BB7A9DB} = {2C607793-B163-4731-A4D1-AFE8A7C4C170}
{9AA1A21B-90EE-4D6C-B47B-8FDA701078EF} = {2C607793-B163-4731-A4D1-AFE8A7C4C170}
{84B0BF2B-17C8-403B-9A26-2310A2A368F9} = {C76D0C23-1FFA-4963-93CD-E12BD643F030} {84B0BF2B-17C8-403B-9A26-2310A2A368F9} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{C1DC0ABC-B053-4E2F-8D9D-E283C68735E6} = {2C607793-B163-4731-A4D1-AFE8A7C4C170}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {92F3083D-793F-4552-8A9A-0AD6534159C9} SolutionGuid = {92F3083D-793F-4552-8A9A-0AD6534159C9}

@ -9,7 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.3" /> <PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.3" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" /> <PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -17,12 +17,12 @@ namespace StubEF
{ {
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<EFChampion>().HasData( modelBuilder.Entity<EFChampion>().HasData(
new EFChampion (1, "Akali", "maBio1", "monIcon1" ), new EFChampion { Id = 1, Name = "Akali", Bio = "maBio1", Icon = "monIcon1" },
new EFChampion (2, "Aatrox", "maBio2", "monIcon2" ), new EFChampion { Id=2, Name="Aatrox", Bio="maBio2", Icon="monIcon2" },
new EFChampion (3, "Ahri", "maBio3", "monIcon3" ), new EFChampion { Id = 3, Name = "Ahri", Bio = "maBio3", Icon = "monIcon3" },
new EFChampion (4, "Akshan", "maBio4", "monIcon4"), new EFChampion { Id = 4, Name = "Akshan", Bio = "maBio4", Icon = "monIcon4" },
new EFChampion (5, "Bard", "maBio5", "monIcon5"), new EFChampion { Id = 5, Name = "Bard", Bio = "maBio5", Icon = "monIcon5" },
new EFChampion (6, "Alistar", "maBio6", "monIcon6") new EFChampion { Id = 6, Name = "Alistar", Bio = "maBio6", Icon = "monIcon6" }
); );
} }
} }

@ -9,20 +9,19 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2"> <PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\API\API.csproj" />
<ProjectReference Include="..\StubEF\StubEF.csproj" /> <ProjectReference Include="..\StubEF\StubEF.csproj" />
</ItemGroup> </ItemGroup>

@ -12,7 +12,7 @@ namespace TestEF
public async Task GetChampion_Test() public async Task GetChampion_Test()
{ {
//connection must be opened to use In-memory database //connection must be opened to use In-memory database
var connection = new SqliteConnection("DataSource=:memory:"); var connection = new SqliteConnection("DataSource =:memory:");
connection.Open(); connection.Open();
var options = new DbContextOptionsBuilder<SQLiteContext>().UseSqlite(connection).Options; var options = new DbContextOptionsBuilder<SQLiteContext>().UseSqlite(connection).Options;

Loading…
Cancel
Save