Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
0edd563
Updates the CreateEmptyDatabase() to specify the location of the data…
GillesTourreau Sep 22, 2025
6dd1083
Add the support in SqlServerDacExtensions to deploy database in a spe…
GillesTourreau Sep 22, 2025
616eb95
Update the SqlServerDacDatabaseInitializer to add the support of addi…
GillesTourreau Sep 22, 2025
8818285
Upgrade the version of CI.
GillesTourreau Sep 22, 2025
c075a61
Add SqlCmd library.
GillesTourreau Sep 23, 2025
88dc018
Updates the README.
GillesTourreau Sep 23, 2025
17701de
Fix unit tests failed.
GillesTourreau Sep 23, 2025
03bee0e
Fix build previously failed.
GillesTourreau Sep 23, 2025
8ad39fd
Add guard for public methods in SqlCmd project.
GillesTourreau Sep 24, 2025
fe3c796
Add the output in the exception message when Sqlcmd execution failed.
GillesTourreau Sep 24, 2025
f1eec4f
Add guard to public APIs.
GillesTourreau Sep 24, 2025
f53f4af
Fix unit tests previously failed.
GillesTourreau Sep 24, 2025
68c588b
Changes the connection strings to retrieve from env variable and afte…
GillesTourreau Sep 24, 2025
614824a
Use the MSBuild.Sdk.SqlProj for the database projects.
GillesTourreau Sep 24, 2025
6378685
Fix unit tests
GillesTourreau Sep 24, 2025
fa0cedb
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
c278445
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
733e91e
Fix build previously failed.
GillesTourreau Sep 24, 2025
8fd746e
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
2a7ec9b
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
252f246
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
c4a9422
Fix unit tests previously failed.
GillesTourreau Sep 24, 2025
4c9cad7
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
53cfb4b
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
869efcb
Fix unit tests.
GillesTourreau Sep 24, 2025
19e67d0
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
90d3555
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
69adfc8
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
619608a
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
99a05d7
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
6ca09e3
Fix unit tests
GillesTourreau Sep 24, 2025
6e2d309
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
cafe137
Fix unit tests
GillesTourreau Sep 24, 2025
5bb21e1
Merge branch 'releases/v3.0.0' of https://github.com/PosInformatique/…
GillesTourreau Sep 24, 2025
68a7b09
Debug
GillesTourreau Sep 24, 2025
779b364
Revert
GillesTourreau Sep 24, 2025
c75b111
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
9eca60c
Update github-actions-ci.yaml
GillesTourreau Sep 24, 2025
572decc
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
7755e10
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
9ed1c4d
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
5159d5a
Debug
GillesTourreau Sep 25, 2025
ee26a2c
Revert "Debug"
GillesTourreau Sep 25, 2025
5bd089b
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
069a200
Fix unit tests previously failed.
GillesTourreau Sep 25, 2025
f525115
Merge branch 'releases/v3.0.0' of https://github.com/PosInformatique/…
GillesTourreau Sep 25, 2025
89056e8
Migrate to xUnit v3.
GillesTourreau Sep 25, 2025
cdebb2e
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
bb11333
Revert "Update github-actions-ci.yaml"
GillesTourreau Sep 25, 2025
0d0430e
Fix CI
GillesTourreau Sep 25, 2025
0d90a30
Fix CI
GillesTourreau Sep 25, 2025
511f3c0
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
224abca
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
ba1a4ab
Update github-actions-ci.yaml
GillesTourreau Sep 25, 2025
185c3f1
Fix CI
GillesTourreau Sep 25, 2025
c268f43
Merge branch 'releases/v3.0.0' of https://github.com/PosInformatique/…
GillesTourreau Sep 25, 2025
0d7da54
Fix CI.
GillesTourreau Sep 25, 2025
fdc3ba7
Revert usage of MTP.
GillesTourreau Sep 25, 2025
2efa057
Restore VS Test
GillesTourreau Sep 25, 2025
4646e2b
Fix unit tests
GillesTourreau Sep 25, 2025
15cccc2
Enable analyzers code in Release
GillesTourreau Sep 25, 2025
c012c92
Fix CI.
GillesTourreau Sep 25, 2025
b2a6d3f
Fix NuGet tags
GillesTourreau Sep 25, 2025
fd00817
Fix release Github actions yaml.
GillesTourreau Sep 29, 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
92 changes: 64 additions & 28 deletions .github/workflows/github-actions-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,78 @@ on:

jobs:
build:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
SA_PASSWORD: "P@ssw0rd12345!"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
volumes:
- /tmp/other_databases_path:/tmp/other_databases_path
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.Testing.Databases.sln

- name: Build solution
run: dotnet build PosInformatique.Testing.Databases.sln --configuration Release --no-restore

- name: Install SQL Server command-line tools
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo apt-get install -y mssql-tools
echo "/opt/mssql-tools/bin" >> $GITHUB_PATH

- name: Prepare SQL databases directory
run: |
# Give the rights to the 'mssql' user to read/write in the /tmp/other_databases_path directory.
docker exec --user root $(docker ps -qf "ancestor=mcr.microsoft.com/mssql/server:2022-latest") chown -R mssql:mssql /tmp/other_databases_path

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

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: (!cancelled())
with:
files: |
TestResults/**/*.trx

build-samples:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup NuGet
uses: nuget/setup-nuget@v2

- name: Restore NuGet packages
run: nuget restore PosInformatique.Testing.Databases.sln
- name: Restore NuGet packages of the samples
run: nuget restore samples/PosInformatique.Testing.Databases.Samples.sln

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build
run: msbuild "PosInformatique.Testing.Databases.sln" /p:Configuration=Debug

- name: Restore NuGet packages
run: nuget restore "samples/PosInformatique.Testing.Databases.Samples.sln"

- name: Build the samples
- name: Build samples with Visual Studio
run: msbuild "samples/PosInformatique.Testing.Databases.Samples.sln" /p:Configuration=Debug

- name: Creates the LocalDB for the tests
shell: cmd
run: SqlLocalDB create posinfo-tests

- name: Creates the SQL Login service accounts for the tests
shell: cmd
run: sqlcmd -S "(localDB)\posinfo-tests" -Q "IF NOT EXISTS (SELECT 1 FROM [sys].[server_principals] WHERE [Name] = 'ServiceAccountLogin') CREATE LOGIN [ServiceAccountLogin] WITH PASSWORD = 'P@ssw0rd'"

# Use this fix https://github.com/microsoft/vstest-action/issues/31#issuecomment-2159463764
- name: Test with the dotnet CLI
uses: rusty-bender/vstest-action@main
with:
searchFolder: .\
testAssembly: |
/tests/**/*tests.dll
!./**/*TestAdapter.dll
!./**/obj/**
15 changes: 11 additions & 4 deletions .github/workflows/github-actions-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
type: string
description: The version of the library
required: true
default: 2.3.0
default: 3.0.0
VersionSuffix:
type: string
description: The version suffix of the library (for example rc.1)

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

jobs:
build:
Expand All @@ -32,19 +32,26 @@ jobs:
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
"src/Testing.Databases.SqlServer/Testing.Databases.SqlServer.csproj"

- name: Build Testing.Databases.SqlServer.Dac
run: dotnet pack
--property:Configuration=Release
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
"src/Testing.Databases.SqlServer.Dac/Testing.Databases.SqlServer.Dac.csproj"

- name: Build Testing.Databases.SqlServer.EntityFramework
run: dotnet pack
--property:Configuration=Release
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
"src/Testing.Databases.SqlServer.EntityFramework/Testing.Databases.SqlServer.EntityFramework.csproj"

- name: Build Testing.Databases.SqlServer.Dac
- name: Build Testing.Databases.SqlServer.SqlCmd
run: dotnet pack
--property:Configuration=Release
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
"src/Testing.Databases.SqlServer.Dac/Testing.Databases.SqlServer.Dac.csproj"
"src/Testing.Databases.SqlServer.SqlCmd/Testing.Databases.SqlServer.SqlCmd.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
3 changes: 0 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<!-- 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;NU1903</NoWarn>

Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.SqlServer.DacFx" Version="162.1.172" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.v3" Version="3.0.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
</ItemGroup>
</Project>
41 changes: 37 additions & 4 deletions PosInformatique.Testing.Databases.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{49103176-7D0
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Testing.Databases.SqlServer.Tests.DacPac", "tests\Testing.Databases.SqlServer.Tests.DacPac\Testing.Databases.SqlServer.Tests.DacPac.sqlproj", "{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Databases.SqlServer.Tests.DacPac", "tests\Testing.Databases.SqlServer.Tests.DacPac\Testing.Databases.SqlServer.Tests.DacPac.csproj", "{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{91BFD2B1-6AB6-4B07-9D2E-430C93F150D4}"
EndProject
Expand All @@ -41,22 +41,32 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\github-actions-release.yml = .github\workflows\github-actions-release.yml
EndProjectSection
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Testing.Databases.SqlServer.Tests.Source", "tests\Testing.Databases.SqlServer.Tests.Source\Testing.Databases.SqlServer.Tests.Source.sqlproj", "{A261D4FF-9BEA-475C-8671-E9BACFDCE960}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Databases.SqlServer.Tests.Source", "tests\Testing.Databases.SqlServer.Tests.Source\Testing.Databases.SqlServer.Tests.Source.csproj", "{A261D4FF-9BEA-475C-8671-E9BACFDCE960}"
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Testing.Databases.SqlServer.Tests.Target", "tests\Testing.Databases.SqlServer.Tests.Target\Testing.Databases.SqlServer.Tests.Target.sqlproj", "{6CD3F177-053F-4816-A37E-5CA6F293D34C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Databases.SqlServer.Tests.Target", "tests\Testing.Databases.SqlServer.Tests.Target\Testing.Databases.SqlServer.Tests.Target.csproj", "{6CD3F177-053F-4816-A37E-5CA6F293D34C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Databases.SqlServer.EntityFramework", "src\Testing.Databases.SqlServer.EntityFramework\Testing.Databases.SqlServer.EntityFramework.csproj", "{157DDF0D-9410-4646-94B9-9CEE4C140F5E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Databases.SqlServer.EntityFramework.Tests", "tests\Testing.Databases.SqlServer.EntityFramework.Tests\Testing.Databases.SqlServer.EntityFramework.Tests.csproj", "{04A7AE8F-FE77-435B-9250-600388BB8065}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{8500A9B6-CAA0-432C-BABB-DDC86CE08994}"
ProjectSection(SolutionItems) = preProject
docs\WriteTest.md = docs\WriteTest.md
docs\WriteDatabaseMigrationTest.md = docs\WriteDatabaseMigrationTest.md
docs\WriteTest.md = docs\WriteTest.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Databases.SqlServer.Dac", "src\Testing.Databases.SqlServer.Dac\Testing.Databases.SqlServer.Dac.csproj", "{8BE60460-EBA5-43DE-B85D-C756E2988DC8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing.Databases.SqlServer.Dac.Tests", "tests\Testing.Databases.SqlServer.Dac.Tests\Testing.Databases.SqlServer.Dac.Tests.csproj", "{6751A585-1BB0-49A1-BF68-D7FBD3392DF6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing.Databases.SqlServer.SqlCmd", "src\Testing.Databases.SqlServer.SqlCmd\Testing.Databases.SqlServer.SqlCmd.csproj", "{D3004122-CCDD-4EAD-BD9E-DA6DFF470943}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing.Databases.SqlServer.SqlCmd.Tests", "tests\Testing.Databases.SqlServer.SqlCmd.Tests\Testing.Databases.SqlServer.SqlCmd.Tests.csproj", "{F8E025D7-4E2F-437A-ABFA-C43A1368E15A}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Testing.Databases.SqlServer.Shared", "src\Testing.Databases.SqlServer.Shared\Testing.Databases.SqlServer.Shared.shproj", "{B9F8C52D-4652-4FC6-A695-DC2F61BA05C9}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Testing.Databases.SqlServer.Shared.Tests", "tests\Testing.Databases.SqlServer.Shared.Tests\Testing.Databases.SqlServer.Shared.Tests.shproj", "{1554EA1B-37C8-4F10-9770-BF4DD8A7E80C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -101,6 +111,18 @@ Global
{8BE60460-EBA5-43DE-B85D-C756E2988DC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BE60460-EBA5-43DE-B85D-C756E2988DC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BE60460-EBA5-43DE-B85D-C756E2988DC8}.Release|Any CPU.Build.0 = Release|Any CPU
{6751A585-1BB0-49A1-BF68-D7FBD3392DF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6751A585-1BB0-49A1-BF68-D7FBD3392DF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6751A585-1BB0-49A1-BF68-D7FBD3392DF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6751A585-1BB0-49A1-BF68-D7FBD3392DF6}.Release|Any CPU.Build.0 = Release|Any CPU
{D3004122-CCDD-4EAD-BD9E-DA6DFF470943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3004122-CCDD-4EAD-BD9E-DA6DFF470943}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3004122-CCDD-4EAD-BD9E-DA6DFF470943}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3004122-CCDD-4EAD-BD9E-DA6DFF470943}.Release|Any CPU.Build.0 = Release|Any CPU
{F8E025D7-4E2F-437A-ABFA-C43A1368E15A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8E025D7-4E2F-437A-ABFA-C43A1368E15A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8E025D7-4E2F-437A-ABFA-C43A1368E15A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8E025D7-4E2F-437A-ABFA-C43A1368E15A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -115,4 +137,15 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FAC64573-D665-48A8-AC75-7B82B692EC9E}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
tests\Testing.Databases.SqlServer.Shared.Tests\Testing.Databases.SqlServer.Shared.Tests.projitems*{04a7ae8f-fe77-435b-9250-600388bb8065}*SharedItemsImports = 5
tests\Testing.Databases.SqlServer.Shared.Tests\Testing.Databases.SqlServer.Shared.Tests.projitems*{1554ea1b-37c8-4f10-9770-bf4dd8a7e80c}*SharedItemsImports = 13
src\Testing.Databases.SqlServer.Shared\Testing.Databases.SqlServer.Shared.projitems*{157ddf0d-9410-4646-94b9-9cee4c140f5e}*SharedItemsImports = 5
tests\Testing.Databases.SqlServer.Shared.Tests\Testing.Databases.SqlServer.Shared.Tests.projitems*{6751a585-1bb0-49a1-bf68-d7fbd3392df6}*SharedItemsImports = 5
src\Testing.Databases.SqlServer.Shared\Testing.Databases.SqlServer.Shared.projitems*{8be60460-eba5-43de-b85d-c756e2988dc8}*SharedItemsImports = 5
src\Testing.Databases.SqlServer.Shared\Testing.Databases.SqlServer.Shared.projitems*{b9f8c52d-4652-4fc6-a695-dc2f61ba05c9}*SharedItemsImports = 13
tests\Testing.Databases.SqlServer.Shared.Tests\Testing.Databases.SqlServer.Shared.Tests.projitems*{c87e8f0d-d96d-4d77-9713-5564dc2e3597}*SharedItemsImports = 5
src\Testing.Databases.SqlServer.Shared\Testing.Databases.SqlServer.Shared.projitems*{d3004122-ccdd-4ead-bd9e-da6dff470943}*SharedItemsImports = 5
tests\Testing.Databases.SqlServer.Shared.Tests\Testing.Databases.SqlServer.Shared.Tests.projitems*{f8e025d7-4e2f-437a-abfa-c43a1368e15a}*SharedItemsImports = 5
EndGlobalSection
EndGlobal
Loading
Loading