diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..f6079cb --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,25 @@ +## Description + +[Description of the bug or feature] + +### Steps to Reproduce + +1. +2. + +### Related code + +``` +insert short code snippets here +``` + +**Expected behavior:** [What you expected to happen] + +**Actual behavior:** [What actually happened] + + + +## Specifications + +- .NET Version : 6.0.0 +- System : CentOS 7.2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5200175 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build + +on: + push: + branches: [ dev, main, master, '**' ] + pull_request: + branches: [ dev, main, master ] + +jobs: + + windows: + name: build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ windows-latest ] + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET SDK 6.0.x and 7.0.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0.x + 6.0.x + + - name: Show dotnet Version + run: | + dotnet --list-sdks + dotnet --list-runtimes + + - name: Build with dotnet + run: | + dotnet build --configuration Release D:\a\FasterKvCache\FasterKvCache\FasterKv.Cache.sln \ No newline at end of file diff --git a/.github/workflows/buildandtest.yml b/.github/workflows/buildandtest.yml new file mode 100644 index 0000000..163ab88 --- /dev/null +++ b/.github/workflows/buildandtest.yml @@ -0,0 +1,42 @@ +name: Build&Test + +on: + push: + branches: [ dev, main, master, '**' ] + pull_request: + branches: [ dev, main, master ] + +jobs: + + linux: + name: build and test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET SDK 6.0.x and 7.0.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0.x + 6.0.x + + - name: Show dotnet Version + run: | + dotnet --list-sdks + dotnet --list-runtimes + + - name: Show docker info + run: | + docker ps -a + + - name: Build with dotnet + run: | + dotnet build --configuration Release /home/runner/work/FasterKvCache/FasterKvCache/FasterKv.Cache.sln + + - name: Run tests on net6.0 + run: | + dotnet test --framework=net6.0 /home/runner/work/FasterKvCache/FasterKvCache/tests/FasterKv.Cache.Core.Tests/FasterKv.Cache.Core.Tests.csproj diff --git a/.github/workflows/release_stable.yml b/.github/workflows/release_stable.yml new file mode 100644 index 0000000..9f7db63 --- /dev/null +++ b/.github/workflows/release_stable.yml @@ -0,0 +1,51 @@ +name: Release_Stable + +on: + push: + tags: + - "*.*.*-beta*" + - "*.*.*-rc*" + +jobs: + build_artifact: + name: Build and upload artifact + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup .NET SDK 6.0.x and 7.0.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0.x + 6.0.x + - name: Build with dotnet + run: dotnet build --configuration Release /home/runner/work/FasterKvCache/FasterKvCache/FasterKv.Cache.sln + - name: Pack with dotnet + env: + VERSION: ${{ github.ref_name }} + run: dotnet pack /home/runner/work/FasterKvCache/FasterKvCache/FasterKv.Cache.sln --version-suffix $VERSION -o /home/runner/work/nugetpkgs -c Release --no-build + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: nugetpkgs + path: /home/runner/work/nugetpkgs + + release_nuget: + name: Release to Nuget + needs: build_artifact + runs-on: ubuntu-latest + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v1 + with: + name: nugetpkgs + - name: list nugetpkgs + run: ls nugetpkgs + - name: Release + run: | + for file in nugetpkgs/*.nupkg + do + dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package + done diff --git a/.github/workflows/release_unstable.yml b/.github/workflows/release_unstable.yml new file mode 100644 index 0000000..aaf55f2 --- /dev/null +++ b/.github/workflows/release_unstable.yml @@ -0,0 +1,52 @@ +name: Release_Unstable + +on: + push: + tags: + - "*.*.*" + - "!*.*.*-beta*" + - "!*.*.*-rc*" + +jobs: + build_artifact: + name: Build and upload artifact + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup .NET SDK 6.0.x and 7.0.x + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0.x + 6.0.x + - name: Build with dotnet + run: dotnet build --configuration Release /home/runner/work/FasterKvCache/FasterKvCache/FasterKv.Cache.sln + - name: Pack with dotnet + env: + VERSION: ${{ github.ref_name }} + run: dotnet pack /home/runner/work/FasterKvCache/FasterKvCache/FasterKv.Cache.sln --version-suffix $VERSION -o /home/runner/work/nugetpkgs -c Release --no-build + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: nugetpkgs + path: /home/runner/work/nugetpkgs + + release_nuget: + name: Release to Nuget + needs: build_artifact + runs-on: ubuntu-latest + + steps: + - name: Download build artifacts + uses: actions/download-artifact@v1 + with: + name: nugetpkgs + - name: list nugetpkgs + run: ls nugetpkgs + - name: Release + run: | + for file in nugetpkgs/*.nupkg + do + dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package + done \ No newline at end of file diff --git a/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreObjectTest.cs b/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreObjectTest.cs index 3ee626c..d1452d7 100644 --- a/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreObjectTest.cs +++ b/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreObjectTest.cs @@ -154,7 +154,7 @@ public async Task DeleteAsync_Key_Should_Success() [Fact] public void Set_Big_DataSize_Should_Success() { - int nums = 10000; + int nums = 1000; for (int i = 0; i < nums; i++) { _fasterKv.Set($"big_data_{i}", new Data @@ -176,7 +176,7 @@ public void Set_Big_DataSize_Should_Success() [Fact] public void Set_Big_DataSize_And_Repeat_Reading_Should_Success() { - int nums = 10000; + int nums = 1000; for (int i = 0; i < nums; i++) { _fasterKv.Set($"big_data_{i}", new Data diff --git a/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreTest.cs b/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreTest.cs index 7eb6fc1..d745b17 100644 --- a/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreTest.cs +++ b/tests/FasterKv.Cache.Core.Tests/KvStore/FasterKvStoreTest.cs @@ -156,7 +156,7 @@ public async Task DeleteAsync_Key_Should_Success() [Fact] public void Set_Big_DataSize_Should_Success() { - int nums = 10000; + int nums = 1000; for (int i = 0; i < nums; i++) { _fasterKv.Set($"big_data_{i}", new Data @@ -178,7 +178,7 @@ public void Set_Big_DataSize_Should_Success() [Fact] public async Task SetAsync_Big_DataSize_Should_Success() { - int nums = 10000; + int nums = 1000; for (int i = 0; i < nums; i++) { await _fasterKv.SetAsync($"big_data_{i}", new Data