Skip to content

Commit ccbcbd4

Browse files
v4.0.0 (#18)
* Migrates the solution to .slnx * Updates the version to v3.1.0 * Updates the CI/CD github actions version * Upgrades to MSBuild.Sdk.SqlProj v5.0.0 (fixes #16) * Migrates to xUnit v4 + MTP (fixes #16) * Upgrades to AwesomeAssertions library (fixes #17) * Updates version to v4.0.0 * Upgrades to .NET 8.0 for minimal version * Adds the TrustServerCertificate option for SqlCmd (fixes #15) * Fix the InsertInto() helper method to add the support of byte type (fixes #14). * Fix cancellation token not propagated. * Fix warnings * Use the Trusted publish for the NuGet packages * Upgrades the solution file to .slnx for the sample * Fix yaml release workflow * Renames the workflow to .yaml * Migrates the sample code to xUnit v4
1 parent fa83397 commit ccbcbd4

30 files changed

Lines changed: 240 additions & 328 deletions

‎.github/workflows/github-actions-ci.yaml‎

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,28 @@ jobs:
2323
volumes:
2424
- /tmp/other_databases_path:/tmp/other_databases_path
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v7
2727

2828
- name: Setup .NET
29-
uses: actions/setup-dotnet@v4
29+
uses: actions/setup-dotnet@v6
3030
with:
31-
dotnet-version: 8.0.x
31+
dotnet-version: 11.0.x
3232

3333
- name: Restore dependencies
34-
run: dotnet restore PosInformatique.Testing.Databases.sln
34+
run: dotnet restore PosInformatique.Testing.Databases.slnx
3535

3636
- name: Build solution
37-
run: dotnet build PosInformatique.Testing.Databases.sln --configuration Release --no-restore
37+
run: dotnet build PosInformatique.Testing.Databases.slnx --configuration Release --no-restore
3838

3939
- name: Install SQL Server command-line tools
4040
run: |
41-
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
42-
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
41+
set -o pipefail
42+
. /etc/os-release
43+
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
44+
curl -fsSL "https://packages.microsoft.com/config/ubuntu/${VERSION_ID}/prod.list" | sudo tee /etc/apt/sources.list.d/msprod.list > /dev/null
4345
sudo apt-get update
44-
sudo apt-get install -y mssql-tools
45-
echo "/opt/mssql-tools/bin" >> $GITHUB_PATH
46+
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
47+
echo "/opt/mssql-tools18/bin" >> "$GITHUB_PATH"
4648
4749
- name: Prepare SQL databases directory
4850
run: |
@@ -51,10 +53,13 @@ jobs:
5153
5254
- name: Run tests
5355
run: |
54-
dotnet test PosInformatique.Testing.Databases.sln \
56+
dotnet test PosInformatique.Testing.Databases.slnx \
5557
--configuration Release \
5658
--no-build \
57-
--logger "trx;LogFileName=test_results.trx" \
59+
--coverage \
60+
--coverage-output-format cobertura \
61+
--coverage-settings CodeCoverage.runsettings \
62+
--report-trx \
5863
--results-directory ./TestResults
5964
env:
6065
SQL_SERVER_UNIT_TESTS_CONNECTION_STRING: "Data Source=localhost,1433;Database=master;User Id=sa;Password=P@ssw0rd12345!;TrustServerCertificate=True;"
@@ -70,16 +75,16 @@ jobs:
7075
build-samples:
7176
runs-on: windows-latest
7277
steps:
73-
- uses: actions/checkout@v4
78+
- uses: actions/checkout@v7
7479

7580
- name: Setup NuGet
76-
uses: nuget/setup-nuget@v2
81+
uses: nuget/setup-nuget@v4
7782

7883
- name: Restore NuGet packages of the samples
79-
run: nuget restore samples/PosInformatique.Testing.Databases.Samples.sln
84+
run: nuget restore samples/PosInformatique.Testing.Databases.Samples.slnx
8085

8186
- name: Add msbuild to PATH
82-
uses: microsoft/setup-msbuild@v2
87+
uses: microsoft/setup-msbuild@v3
8388

8489
- name: Build samples with Visual Studio
85-
run: msbuild "samples/PosInformatique.Testing.Databases.Samples.sln" /p:Configuration=Debug
90+
run: msbuild "samples/PosInformatique.Testing.Databases.Samples.slnx" /p:Configuration=Debug

.github/workflows/github-actions-release.yml renamed to .github/workflows/github-actions-release.yaml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
type: string
88
description: The version of the library
99
required: true
10-
default: 3.0.0
10+
default: 4.0.0
1111
VersionSuffix:
1212
type: string
1313
description: The version suffix of the library (for example rc.1)
@@ -17,13 +17,16 @@ run-name: ${{ inputs.VersionSuffix && format('{0}-{1}', inputs.VersionPrefix, in
1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20+
permissions:
21+
id-token: write
22+
contents: read
2023
steps:
21-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v7
2225

2326
- name: Setup .NET 8.x
24-
uses: actions/setup-dotnet@v4
27+
uses: actions/setup-dotnet@v6
2528
with:
26-
dotnet-version: '8.x'
29+
dotnet-version: '11.x'
2730

2831
- name: Build Testing.Databases.SqlServer
2932
run: dotnet pack
@@ -53,5 +56,15 @@ jobs:
5356
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
5457
"src/Testing.Databases.SqlServer.SqlCmd/Testing.Databases.SqlServer.SqlCmd.csproj"
5558

59+
- name: NuGet login
60+
uses: NuGet/login@v1
61+
id: nuget_login
62+
with:
63+
user: ${{ secrets.NUGET_USER }}
64+
5665
- name: Publish the package to nuget.org
57-
run: dotnet nuget push "src/**/bin/Release/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
66+
run: |
67+
dotnet nuget push "src/**/bin/Release/*.nupkg" \
68+
--api-key "${{steps.nuget_login.outputs.NUGET_API_KEY}}" \
69+
--source https://api.nuget.org/v3/index.json \
70+
--skip-duplicate

‎CodeCoverage.runsettings‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- File name extension must be .runsettings -->
32
<RunSettings>
43
<DataCollectionRunSettings>
54
<DataCollectors>

‎Directory.Packages.props‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
7-
<PackageVersion Include="FluentAssertions" Version="7.2.0" />
8-
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.0.1" />
9-
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
10-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
11-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0" />
12-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
6+
<PackageVersion Include="AwesomeAssertions" Version="9.6.0" />
7+
<PackageVersion Include="AwesomeAssertions.DataSets" Version="9.0.0" />
8+
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.3" />
9+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
10+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
11+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
1312
<PackageVersion Include="Microsoft.SqlServer.DacFx" Version="162.1.172" />
14-
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
15-
<PackageVersion Include="xunit.v3" Version="3.0.1" />
16-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
13+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.12.0" />
14+
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="2.5.3" />
15+
<PackageVersion Include="StyleCop.Analyzers" Version="1.3.180" />
16+
<PackageVersion Include="xunit.analyzers" Version="2.2.0" />
17+
<PackageVersion Include="xunit.v3.core.mtp-v2" Version="4.0.3" />
1718
</ItemGroup>
1819
</Project>

‎PosInformatique.Testing.Databases.sln‎

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)