Skip to content

Commit e79b405

Browse files
v1.0.0 (#3)
* Initial version
1 parent 8cd40df commit e79b405

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2166
-1
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[*.csproj]
2+
indent_style = space
3+
indent_size = 2
4+
5+
[*.cs]
6+
indent_style = space
7+
indent_size = 4
8+
9+
# Visual Studio
10+
11+
# IDE0130: Namespace does not match folder structure
12+
dotnet_diagnostic.IDE0130.severity = none
13+
14+
# IDE0290: Use primary constructor
15+
dotnet_diagnostic.IDE0290.severity = none
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "releases/**" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
services:
13+
sqlserver:
14+
image: mcr.microsoft.com/mssql/server:2022-latest
15+
env:
16+
SA_PASSWORD: "P@ssw0rd12345!"
17+
ACCEPT_EULA: "Y"
18+
ports:
19+
- 1433:1433
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: 8.0.x
27+
28+
- name: Restore dependencies
29+
run: dotnet restore PosInformatique.Database.Updater.sln
30+
31+
- name: Build solution
32+
run: dotnet build PosInformatique.Database.Updater.sln --configuration Release --no-restore
33+
34+
- name: Run tests
35+
run: |
36+
dotnet test PosInformatique.Database.Updater.sln \
37+
--configuration Release \
38+
--no-build \
39+
--logger "trx;LogFileName=test_results.trx" \
40+
--results-directory ./TestResults
41+
env:
42+
DATABASE_UPDATER_UNIT_TESTS_CONNECTION_STRING: "Data Source=localhost,1433;Database=master;User Id=sa;Password=P@ssw0rd12345!;TrustServerCertificate=True;"
43+
44+
- name: Publish Test Results
45+
uses: EnricoMi/publish-unit-test-result-action@v2
46+
if: (!cancelled())
47+
with:
48+
files: |
49+
TestResults/**/*.trx
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
VersionPrefix:
7+
type: string
8+
description: The version of the library
9+
required: true
10+
default: 1.0.0
11+
VersionSuffix:
12+
type: string
13+
description: The version suffix of the library (for example rc.1)
14+
15+
run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, inputs.VersionSuffix) || inputs.VersionPrefix }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup .NET 8.x
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: '8.x'
27+
28+
- name: Build PosInformatique.Database.Updater
29+
run: dotnet pack
30+
--property:Configuration=Release
31+
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
32+
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
33+
"src/Database.Updater/Database.Updater.csproj"
34+
35+
- name: Publish the package to nuget.org
36+
run: dotnet nuget push "src/**/bin/Release/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate

Directory.Build.props

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<Project>
2+
3+
<!-- Common properties -->
4+
<PropertyGroup>
5+
<Authors>Gilles TOURREAU</Authors>
6+
<Company>P.O.S Informatique</Company>
7+
<Product>P.O.S Informatique</Product>
8+
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
9+
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.Database.Updater</RepositoryUrl>
10+
<RepositoryType>git</RepositoryType>
11+
12+
<!-- Enable the last version of C# -->
13+
<LangVersion>latest</LangVersion>
14+
15+
<!-- Enable implict usings -->
16+
<ImplicitUsings>enable</ImplicitUsings>
17+
18+
<!-- Disable the Analyzers in Release configuration -->
19+
<RunAnalyzers Condition="'$(Configuration)' == 'Release'">false</RunAnalyzers>
20+
21+
<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
22+
<NoWarn>$(NoWarn);SA0001</NoWarn>
23+
24+
<!-- By default prefix all the assemblies name with ChantierConnect -->
25+
<AssemblyName>PosInformatique.$(MSBuildProjectName)</AssemblyName>
26+
<RootNamespace>PosInformatique.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<AdditionalFiles Include="..\..\stylecop.json">
31+
<Link>stylecop.json</Link>
32+
</AdditionalFiles>
33+
</ItemGroup>
34+
35+
<!-- Common NuGet packages -->
36+
<ItemGroup>
37+
<PackageReference Include="StyleCop.Analyzers">
38+
<PrivateAssets>all</PrivateAssets>
39+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
40+
</PackageReference>
41+
</ItemGroup>
42+
43+
<!-- Add the default using directive for all the code -->
44+
<ItemGroup>
45+
<Using Include="System" />
46+
<Using Include="System.Threading.Tasks" />
47+
</ItemGroup>
48+
49+
</Project>

Directory.Packages.props

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
7+
<PackageVersion Include="FluentAssertions" Version="8.8.0" />
8+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
9+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
10+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
12+
<PackageVersion Include="PosInformatique.Testing.Databases.SqlServer" Version="3.0.0" />
13+
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
14+
<PackageVersion Include="System.CommandLine" Version="2.0.0" />
15+
<PackageVersion Include="xunit.v3" Version="3.2.0" />
16+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
17+
</ItemGroup>
18+
</Project>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36408.4
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater", "src\Database.Updater\Database.Updater.csproj", "{961D82E3-18B9-4CB4-B290-8146D874AB39}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
9+
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
.gitignore = .gitignore
12+
Directory.Build.props = Directory.Build.props
13+
Directory.Packages.props = Directory.Packages.props
14+
LICENSE = LICENSE
15+
README.md = README.md
16+
stylecop.json = stylecop.json
17+
EndProjectSection
18+
EndProject
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater.Tests", "tests\Database.Updater.Tests\Database.Updater.Tests.csproj", "{8788FC9A-8CAE-4A45-8832-18E29AF38838}"
20+
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater.IntegrationTests", "tests\Database.Updater.IntegrationTests\Database.Updater.IntegrationTests.csproj", "{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}"
22+
EndProject
23+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater.Tests.MigrationsAssembly", "tests\Database.Updater.Tests.MigrationsAssembly\Database.Updater.Tests.MigrationsAssembly.csproj", "{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}"
24+
EndProject
25+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{DF126F11-BF03-4B7E-B2F2-3A23E7FE6BF0}"
26+
ProjectSection(SolutionItems) = preProject
27+
tests\.editorconfig = tests\.editorconfig
28+
tests\Directory.Build.props = tests\Directory.Build.props
29+
EndProjectSection
30+
EndProject
31+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BF73C1D5-EF4C-4F34-9944-0D74667BE6A8}"
32+
ProjectSection(SolutionItems) = preProject
33+
src\Directory.Build.props = src\Directory.Build.props
34+
EndProjectSection
35+
EndProject
36+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E9100678-42A3-461A-B8F0-DF12DA892979}"
37+
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater.Tests.MigrationsErrorAssembly", "tests\Database.Updater.Tests.MigrationsErrorAssembly\Database.Updater.Tests.MigrationsErrorAssembly.csproj", "{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}"
39+
EndProject
40+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{25236396-6913-4183-B770-631C6FDACA15}"
41+
EndProject
42+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{20A16198-31B4-4155-AE36-AB1942F382A6}"
43+
ProjectSection(SolutionItems) = preProject
44+
.github\workflows\github-actions-ci.yaml = .github\workflows\github-actions-ci.yaml
45+
.github\workflows\github-actions-release.yml = .github\workflows\github-actions-release.yml
46+
EndProjectSection
47+
EndProject
48+
Global
49+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
50+
Debug|Any CPU = Debug|Any CPU
51+
Release|Any CPU = Release|Any CPU
52+
EndGlobalSection
53+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
54+
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Release|Any CPU.ActiveCfg = Release|Any CPU
57+
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Release|Any CPU.Build.0 = Release|Any CPU
58+
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59+
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Debug|Any CPU.Build.0 = Debug|Any CPU
60+
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Release|Any CPU.ActiveCfg = Release|Any CPU
61+
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Release|Any CPU.Build.0 = Release|Any CPU
62+
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63+
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
64+
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
65+
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Release|Any CPU.Build.0 = Release|Any CPU
66+
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67+
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
68+
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
69+
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Release|Any CPU.Build.0 = Release|Any CPU
70+
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
71+
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
72+
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
73+
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Release|Any CPU.Build.0 = Release|Any CPU
74+
EndGlobalSection
75+
GlobalSection(SolutionProperties) = preSolution
76+
HideSolutionNode = FALSE
77+
EndGlobalSection
78+
GlobalSection(NestedProjects) = preSolution
79+
{8788FC9A-8CAE-4A45-8832-18E29AF38838} = {E9100678-42A3-461A-B8F0-DF12DA892979}
80+
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8} = {E9100678-42A3-461A-B8F0-DF12DA892979}
81+
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3} = {E9100678-42A3-461A-B8F0-DF12DA892979}
82+
{DF126F11-BF03-4B7E-B2F2-3A23E7FE6BF0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
83+
{BF73C1D5-EF4C-4F34-9944-0D74667BE6A8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
84+
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8} = {E9100678-42A3-461A-B8F0-DF12DA892979}
85+
{25236396-6913-4183-B770-631C6FDACA15} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
86+
{20A16198-31B4-4155-AE36-AB1942F382A6} = {25236396-6913-4183-B770-631C6FDACA15}
87+
EndGlobalSection
88+
GlobalSection(ExtensibilityGlobals) = postSolution
89+
SolutionGuid = {30DF5A1B-3B00-40E8-90F0-FA6F5846B215}
90+
EndGlobalSection
91+
EndGlobal

0 commit comments

Comments
 (0)