Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v7

- name: Restore & Build
run: dotnet build ${{ env.SOLUTION }} --configuration Release -p:TargetFrameworks=net8.0
run: dotnet build ${{ env.SOLUTION }} --configuration Release -p:TargetFrameworks=net10.0

- name: Start SQL Server
shell: bash
Expand All @@ -67,7 +67,7 @@ jobs:
exit 1

- name: Test
run: dotnet test ${{ env.SOLUTION }} --configuration Release --no-restore --no-build -p:TargetFrameworks=net8.0 --logger GitHubActions
run: dotnet test ${{ env.SOLUTION }} --configuration Release --no-restore --no-build -p:TargetFrameworks=net10.0 --logger GitHubActions

pack:
name: Create NuGet package
Expand Down
3 changes: 1 addition & 2 deletions src/NLog.Database/NLog.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ https://github.com/NLog/NLog/wiki/Database-target
<Title>NLog.Database for NetStandard 2.1</Title>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net10.0' ">
<!-- CS8600: Maybe-null value to non-nullable type. https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-messages/nullable-warnings#possible-null-assigned-to-a-nonnullable-reference -->
<!-- CS8603: Possible null return. https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-messages/nullable-warnings#possible-null-assigned-to-a-nonnullable-reference -->
<!-- CS8604: Possible null argument. https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-messages/nullable-warnings#possible-null-assigned-to-a-nonnullable-reference -->
Expand All @@ -75,7 +75,6 @@ https://github.com/NLog/NLog/wiki/Database-target

<ItemGroup>
<PackageReference Include="NLog" Version="6.1.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">
Expand Down
107 changes: 55 additions & 52 deletions tests/NLog.Database.Tests/NLog.Database.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,56 +1,59 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' AND '$(VisualStudioVersion)' &lt; '17.0' ">net462</TargetFrameworks>
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' ">net462;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>

<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

<DebugType Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">Full</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(monobuild)' != '' ">
<DefineConstants>$(DefineConstants);MONO</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(monobuild)' != '' ">
<PackageReference Include="Mono.Data.Sqlite.Portable" Version="1.0.3.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite" />
<Reference Include="System.Transactions" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.115.5" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.7" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.20" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" /> <!-- Help Microsoft.Data.SqlClient -->
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.35.1" /> <!-- Help Microsoft.Data.SqlClient -->
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NLog.Database\NLog.Database.csproj" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' AND '$(VisualStudioVersion)' &lt; '17.0' ">net462</TargetFrameworks>
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' ">net462;net10.0</TargetFrameworks>

<IsPackable>false</IsPackable>

<AssemblyOriginatorKeyFile>NLogTests.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

<DebugType Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">Full</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(monobuild)' != '' ">
<DefineConstants>$(DefineConstants);MONO</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(monobuild)' != '' ">
<PackageReference Include="Mono.Data.Sqlite.Portable" Version="1.0.3.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite" />
<Reference Include="System.Transactions" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0' ">
<PackageReference Include="System.Data.SqlClient" Version="4.9.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.1.1" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.22" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.14" />
<PackageReference Include="System.Drawing.Common" Version="10.0.14" />
<!-- Help Microsoft.Data.SqlClient -->
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.23.0" />
<!-- Help Microsoft.Data.SqlClient -->
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NLog.Database\NLog.Database.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion tests/NLog.Database.Tests/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Database tests

GitHub Actions runs the test suite on Windows and Ubuntu. Windows uses LocalDB; Ubuntu targets .NET 8 and runs against a SQL Server 2019 Developer container.
GitHub Actions runs the test suite on Windows and Ubuntu. Windows uses LocalDB; Ubuntu targets .NET 10 and runs against a SQL Server 2019 Developer container.

The Ubuntu job generates a cryptographically random SQL Server password for each run and masks it in the Actions logs. The SQL Server integration tests use `SQLSERVER_TEST_CONNECTION_STRING` when set. The configured login must be able to create and drop the `NLogTest` database. When unset, Windows tests use LocalDB; Linux tests require the variable to point to a SQL Server instance.
Loading