Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
be5260f
Initial version
GillesTourreau Sep 4, 2025
8a5fbab
Add github workflows.
GillesTourreau Sep 4, 2025
e714a80
Remove sample in the workflow.
GillesTourreau Sep 4, 2025
c06b17c
Fix the workflow
GillesTourreau Sep 4, 2025
f515bb6
Fix the version
GillesTourreau Sep 4, 2025
61166fa
Fix workflow
GillesTourreau Sep 4, 2025
ddee3a0
Add the UseSqlServer() method to specify the database provider to use.
GillesTourreau Sep 4, 2025
4df79ab
Improve separation of the database provider.
GillesTourreau Sep 4, 2025
377ef5b
Add logging extension support.
GillesTourreau Sep 4, 2025
d16dbf1
Add an option to throw an exception instead of exit code = 99.
GillesTourreau Sep 4, 2025
908600d
Use the last version of the PosInformatique.Testing.Databases packages.
GillesTourreau Sep 11, 2025
6c63c50
Remove usage of System.CommandLine.Hosting
GillesTourreau Sep 22, 2025
d338638
Remove the explicit try/catch mechanism of the exceptions in the Enti…
GillesTourreau Sep 22, 2025
4936f8c
Refactoring/simplify the architecture of the migration process.
GillesTourreau Sep 22, 2025
dd239e5
Add unit tests for the InMemoryLoggingProvider.
GillesTourreau Sep 22, 2025
148ec17
Fix unit tests
GillesTourreau Sep 22, 2025
654c403
Migrate to xUnit v3.
GillesTourreau Sep 22, 2025
a278f9d
Fix CI.
GillesTourreau Sep 22, 2025
34f8160
Remove dependency to Dac.
GillesTourreau Sep 29, 2025
73417ef
Set the connection strings from environment variable.
GillesTourreau Sep 29, 2025
782ce4f
Fix CI to use ubuntu.
GillesTourreau Sep 29, 2025
3c4bdac
Upgrade NuGet packages and fix CI for the unit tests.
GillesTourreau Sep 29, 2025
6c13fc4
Fix unit tests.
GillesTourreau Sep 29, 2025
2945aa4
Fix the README.
GillesTourreau Nov 7, 2025
f55e9e7
Upgrade NuGet packages.
GillesTourreau Nov 7, 2025
5b672a6
Upgrades the System.CommandLine to the official 2.0.0 version.
GillesTourreau Nov 16, 2025
a69e047
Add the "--skip-duplicate" when publishing on NuGet.
GillesTourreau Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*.csproj]
indent_style = space
indent_size = 2

[*.cs]
indent_style = space
indent_size = 4

# Visual Studio

# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = none

# IDE0290: Use primary constructor
dotnet_diagnostic.IDE0290.severity = none
49 changes: 49 additions & 0 deletions .github/workflows/github-actions-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Continuous Integration

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "releases/**" ]

jobs:
build:
runs-on: ubuntu-latest
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
SA_PASSWORD: "P@ssw0rd12345!"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore PosInformatique.Database.Updater.sln

- name: Build solution
run: dotnet build PosInformatique.Database.Updater.sln --configuration Release --no-restore

- name: Run tests
run: |
dotnet test PosInformatique.Database.Updater.sln \
--configuration Release \
--no-build \
--logger "trx;LogFileName=test_results.trx" \
--results-directory ./TestResults
env:
DATABASE_UPDATER_UNIT_TESTS_CONNECTION_STRING: "Data Source=localhost,1433;Database=master;User Id=sa;Password=P@ssw0rd12345!;TrustServerCertificate=True;"

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: (!cancelled())
with:
files: |
TestResults/**/*.trx
36 changes: 36 additions & 0 deletions .github/workflows/github-actions-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
workflow_dispatch:
inputs:
VersionPrefix:
type: string
description: The version of the library
required: true
default: 1.0.0
VersionSuffix:
type: string
description: The version suffix of the library (for example rc.1)

run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, inputs.VersionSuffix) || inputs.VersionPrefix }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET 8.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- name: Build PosInformatique.Database.Updater
run: dotnet pack
--property:Configuration=Release
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
"src/Database.Updater/Database.Updater.csproj"

- name: Publish the package to nuget.org
run: dotnet nuget push "src/**/bin/Release/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
49 changes: 49 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Project>

<!-- Common properties -->
<PropertyGroup>
<Authors>Gilles TOURREAU</Authors>
<Company>P.O.S Informatique</Company>
<Product>P.O.S Informatique</Product>
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.Database.Updater</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- Enable the last version of C# -->
<LangVersion>latest</LangVersion>

<!-- Enable implict usings -->
<ImplicitUsings>enable</ImplicitUsings>

<!-- Disable the Analyzers in Release configuration -->
<RunAnalyzers Condition="'$(Configuration)' == 'Release'">false</RunAnalyzers>

<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
<NoWarn>$(NoWarn);SA0001</NoWarn>

<!-- By default prefix all the assemblies name with ChantierConnect -->
<AssemblyName>PosInformatique.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>PosInformatique.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
</ItemGroup>

<!-- Common NuGet packages -->
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Add the default using directive for all the code -->
<ItemGroup>
<Using Include="System" />
<Using Include="System.Threading.Tasks" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="FluentAssertions" Version="8.8.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="PosInformatique.Testing.Databases.SqlServer" Version="3.0.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="System.CommandLine" Version="2.0.0" />
<PackageVersion Include="xunit.v3" Version="3.2.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>
</Project>
91 changes: 91 additions & 0 deletions PosInformatique.Database.Updater.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36408.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater", "src\Database.Updater\Database.Updater.csproj", "{961D82E3-18B9-4CB4-B290-8146D874AB39}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
LICENSE = LICENSE
README.md = README.md
stylecop.json = stylecop.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater.Tests", "tests\Database.Updater.Tests\Database.Updater.Tests.csproj", "{8788FC9A-8CAE-4A45-8832-18E29AF38838}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.Updater.IntegrationTests", "tests\Database.Updater.IntegrationTests\Database.Updater.IntegrationTests.csproj", "{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}"
EndProject
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}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{DF126F11-BF03-4B7E-B2F2-3A23E7FE6BF0}"
ProjectSection(SolutionItems) = preProject
tests\.editorconfig = tests\.editorconfig
tests\Directory.Build.props = tests\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BF73C1D5-EF4C-4F34-9944-0D74667BE6A8}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E9100678-42A3-461A-B8F0-DF12DA892979}"
EndProject
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}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{25236396-6913-4183-B770-631C6FDACA15}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{20A16198-31B4-4155-AE36-AB1942F382A6}"
ProjectSection(SolutionItems) = preProject
.github\workflows\github-actions-ci.yaml = .github\workflows\github-actions-ci.yaml
.github\workflows\github-actions-release.yml = .github\workflows\github-actions-release.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{961D82E3-18B9-4CB4-B290-8146D874AB39}.Release|Any CPU.Build.0 = Release|Any CPU
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8788FC9A-8CAE-4A45-8832-18E29AF38838}.Release|Any CPU.Build.0 = Release|Any CPU
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8}.Release|Any CPU.Build.0 = Release|Any CPU
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3}.Release|Any CPU.Build.0 = Release|Any CPU
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8788FC9A-8CAE-4A45-8832-18E29AF38838} = {E9100678-42A3-461A-B8F0-DF12DA892979}
{64B1BA81-69E9-AE03-F57A-BE4A0B20A9E8} = {E9100678-42A3-461A-B8F0-DF12DA892979}
{FFFBF4C0-674C-EA8E-7714-76A92E6973E3} = {E9100678-42A3-461A-B8F0-DF12DA892979}
{DF126F11-BF03-4B7E-B2F2-3A23E7FE6BF0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{BF73C1D5-EF4C-4F34-9944-0D74667BE6A8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{6C0F0292-EB9E-EB63-C1D8-1C8B63E59FC8} = {E9100678-42A3-461A-B8F0-DF12DA892979}
{25236396-6913-4183-B770-631C6FDACA15} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{20A16198-31B4-4155-AE36-AB1942F382A6} = {25236396-6913-4183-B770-631C6FDACA15}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {30DF5A1B-3B00-40E8-90F0-FA6F5846B215}
EndGlobalSection
EndGlobal
Loading
Loading