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

Upgrade to the net 9.0. #104

Merged
merged 3 commits into from
Nov 14, 2024
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
48 changes: 24 additions & 24 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ name: Build and Test

on:
push:
branches: [ "main" ]
branches: ['main']
paths-ignore:
- '*.md'
- '*.md'
pull_request:
branches: [ "main" ]
branches: ['main']
paths-ignore:
- '*.md'
- '*.md'

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
7.0.x
6.0.x
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./src
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
working-directory: ./src
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
9.0.x
8.0.x
7.0.x
6.0.x
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./src
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
working-directory: ./src
54 changes: 27 additions & 27 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ on:
workflow_dispatch:
inputs:
name:
description: "When you press run workflow, the nuget package will be published."
default: "I understand."
description: 'When you press run workflow, the nuget package will be published.'
default: 'I understand.'
jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
7.0.x
6.0.x
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./src
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
working-directory: ./src
- name: Publish the package to nuget.org
run: dotnet nuget push ZoneTree/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
working-directory: ./src
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
9.0.x
8.0.x
7.0.x
6.0.x
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./src
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
working-directory: ./src
- name: Publish the package to nuget.org
run: dotnet nuget push ZoneTree/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
working-directory: ./src
2 changes: 1 addition & 1 deletion src/Playground/Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<Configurations>Debug;Release;ReleaseWithDoc</Configurations>
Expand Down
12 changes: 4 additions & 8 deletions src/ZoneTree.UnitTests/SafeBplusTreeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,13 @@ public void BTreeIteratorParallelInserts(BTreeLockMode lockMode)
{
var key = random.Next();
tree.AddOrUpdate(key,
AddOrUpdateResult (ref int value) =>
void (ref int value) =>
{
value = key + key;
return AddOrUpdateResult.ADDED;
},
AddOrUpdateResult (ref int value) =>
void (ref int value) =>
{
value = key + key;
return AddOrUpdateResult.UPDATED;
}, out _);
});
});
Expand Down Expand Up @@ -203,15 +201,13 @@ public void BTreeReverseIteratorParallelInserts(BTreeLockMode lockMode)
{
var key = random.Next();
tree.AddOrUpdate(key,
AddOrUpdateResult (ref int x) =>
void (ref int x) =>
{
x = key + key;
return AddOrUpdateResult.ADDED;
},
AddOrUpdateResult (ref int y) =>
void (ref int y) =>
{
y = key + key;
return AddOrUpdateResult.UPDATED;
}, out _);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/ZoneTree.UnitTests/ZoneTree.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>

Expand Down
4 changes: 2 additions & 2 deletions src/ZoneTree/Collections/BTree/BTree.Write.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public bool TryInsert(in TKey key, in TValue value, out long opIndex)
}
}

public delegate AddOrUpdateResult AddDelegate(ref TValue value);
public delegate void AddDelegate(ref TValue value);

public delegate AddOrUpdateResult UpdateDelegate(ref TValue value);
public delegate void UpdateDelegate(ref TValue value);

public AddOrUpdateResult AddOrUpdate(
in TKey key,
Expand Down
4 changes: 2 additions & 2 deletions src/ZoneTree/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Authors>Ahmed Yasin Koculu</Authors>
<PackageId>ZoneTree</PackageId>
<Title>ZoneTree</Title>
<ProductVersion>1.8.3.0</ProductVersion>
<Version>1.8.3.0</Version>
<ProductVersion>1.8.4.0</ProductVersion>
<Version>1.8.4.0</Version>
<Authors>Ahmed Yasin Koculu</Authors>
<AssemblyTitle>ZoneTree</AssemblyTitle>
<Description>ZoneTree is a persistent, high-performance, transactional, ACID-compliant ordered key-value database for NET. It can operate in memory or on local/cloud storage.</Description>
Expand Down
6 changes: 2 additions & 4 deletions src/ZoneTree/Segments/InMemory/MutableSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,15 @@ public AddOrUpdateResult Delete(in TKey key, out long opIndex)

var status = BTree
.AddOrUpdate(key,
AddOrUpdateResult (ref TValue x) =>
void (ref TValue x) =>
{
MarkValueDeleted(ref x);
insertedValue = x;
return AddOrUpdateResult.ADDED;
},
AddOrUpdateResult (ref TValue x) =>
void (ref TValue x) =>
{
MarkValueDeleted(ref x);
insertedValue = x;
return AddOrUpdateResult.UPDATED;
}, out opIndex);
WriteAheadLog.Append(in key, in insertedValue, opIndex);
return status;
Expand Down
2 changes: 1 addition & 1 deletion src/ZoneTree/ZoneTree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<NeutralLanguage>en-US</NeutralLanguage>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<RepositoryUrl>https://github.com/koculu/ZoneTree</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Loading