Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference updates #33

Closed
wants to merge 7 commits into from
Closed
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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '6.0.x', '7.0.x', '8.0.x' ]

steps:
- uses: actions/checkout@v3

- name: Setup .NET Framework
- name: Setup .NET ${{ matrix.dotnet }} Framework
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet }}

- name: Install SQLite Spatial
run: sudo apt-get install -y libsqlite3-mod-spatialite
Expand All @@ -34,10 +34,10 @@ jobs:
- name: Test
run: dotnet test --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Collect to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Collect to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

- name: Pack NuGet
run: dotnet pack --version-suffix $GITHUB_RUN_ID -c Release -o ./nuget
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '6.0.x', '7.0.x', '8.0.x' ]

steps:
- uses: actions/checkout@v3

- name: Setup .NET Framework
- name: Setup .NET ${{ matrix.dotnet }} Framework
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
dotnet-version: ${{ matrix.dotnet }}

- name: Install SQLite Spatial
run: sudo apt-get install -y libsqlite3-mod-spatialite
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x

- name: Get tag
id: tag
Expand Down
6 changes: 6 additions & 0 deletions src/Deveel.Repository.Core/Deveel.Repository.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.2.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.8" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.12" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Finbuckle.MultiTenant.EntityFrameworkCore" Version="6.12.0" />
<PackageReference Include="Finbuckle.MultiTenant.EntityFrameworkCore" Version="6.13.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Deveel.Repository.Core\Deveel.Repository.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Title>Deveel Repository Finbuckle Multi-Tenant Extension</Title>
Expand All @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Finbuckle.MultiTenant" Version="6.12.0" />
<PackageReference Include="Finbuckle.MultiTenant" Version="6.13.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyCaching.Core" Version="1.9.1" />
<PackageReference Include="EasyCaching.Core" Version="1.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Finbuckle.MultiTenant" Version="6.12.0" />
<PackageReference Include="MongoFramework" Version="0.29.0" />
</ItemGroup>

Expand Down
10 changes: 6 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>Deveel</RootNamespace>
<VersionPrefix>1.2.8</VersionPrefix>
<VersionPrefix>1.3.0</VersionPrefix>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- NuGet Metadata and Commands -->
<Authors>Antonello Provenzano</Authors>
<Company>Deveel AS</Company>
<Copyright>(C) 2022-2023 Deveel AS</Copyright>
<Copyright>(C) 2022-2024 Antonello Provenzano</Copyright>
<PackageProjectUrl>https://github.com/deveel/deveel.repository</PackageProjectUrl>
<RepositoryUrl>https://github.com/deveel/deveel.repository</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -24,7 +24,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="'$(TargetFramework)' != 'net8.0'"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" Condition="'$(TargetFramework)' == 'net8.0'"/>

</ItemGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\src\Deveel.Repository.Core\Deveel.Repository.Core.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public override async Task DisposeAsync() {

await dbContext.DisposeAsync();

await base.DisposeAsync();
// await base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,17 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) {
modelBuilder.Entity<DbTenantPerson>()
.HasMany(x => x.Relationships)
.WithOne(x => x.Person)
.HasForeignKey(x => x.PersonId);
.HasForeignKey(x => x.PersonId)
.OnDelete(DeleteBehavior.Cascade);

modelBuilder.Entity<DbTenantPerson>()
.IsMultiTenant();

modelBuilder.Entity<DbTenantPersonRelationship>();
modelBuilder.Entity<DbTenantPersonRelationship>()
.HasOne(x => x.Person)
.WithMany(x => x.Relationships)
.HasForeignKey(x => x.PersonId)
.OnDelete(DeleteBehavior.Cascade);

base.OnModelCreating(modelBuilder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Deveel.Data {
public class SqlTestConnection : IDisposable {
public SqlTestConnection() {
Connection = new SqliteConnection("DataSource=:memory:");
Connection = new SqliteConnection("Data Source=TestDb;Mode=Memory;Cache=Shared");
if (Connection.State != System.Data.ConnectionState.Open)
Connection.Open();

Expand All @@ -15,7 +15,9 @@ public SqlTestConnection() {
public SqliteConnection Connection { get; }

public void Dispose() {
Connection?.Close();
if (Connection.State != System.Data.ConnectionState.Closed)
Connection?.Close();

Connection?.Dispose();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuite" Version="7.0.12" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuite" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="SQLitePCLRaw.bundle_sqlite3" Version="2.1.6" Condition="'$(OS)' != 'Windows_NT'" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.6" Condition="'$(OS)' == 'Windows_NT'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Xunit.Abstractions;

namespace Deveel.Data {
public abstract class EntityManagerTestSuite<TManager, TPerson, TKey> : IAsyncLifetime
public abstract class EntityManagerTestSuite<TManager, TPerson, TKey> : IAsyncLifetime, IAsyncDisposable
where TManager : EntityManager<TPerson, TKey>
where TPerson : class, IPerson<TKey>, new()
where TKey : notnull {
Expand Down Expand Up @@ -63,7 +63,9 @@ public virtual async Task InitializeAsync() {

public virtual async Task DisposeAsync() {
await Repository.RemoveRangeAsync(People);
}

async ValueTask IAsyncDisposable.DisposeAsync() {
await scope.DisposeAsync();
(Services as IDisposable)?.Dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Xunit.Abstractions;

namespace Deveel.Data {
public abstract class RepositoryTestSuite<TPerson, TKey, TRelationship> : IAsyncLifetime
public abstract class RepositoryTestSuite<TPerson, TKey, TRelationship> : IAsyncLifetime, IAsyncDisposable
where TPerson : class, IPerson<TKey>
where TKey : notnull
where TRelationship : class, IRelationship {
Expand Down Expand Up @@ -74,15 +74,17 @@ protected virtual async Task InitializeAsync() {
await SeedAsync(Repository);
}

async Task IAsyncLifetime.DisposeAsync() {
await DisposeAsync();

async ValueTask IAsyncDisposable.DisposeAsync() {
People = null;

await scope.DisposeAsync();
(services as IDisposable)?.Dispose();
}

async Task IAsyncLifetime.DisposeAsync() {
await DisposeAsync();
}

protected virtual Task DisposeAsync() {
return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit" Version="2.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -23,7 +23,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23503-02"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3"/>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading