From 14e7f01967189a28404a45513955d3dd64182921 Mon Sep 17 00:00:00 2001 From: mokarchi Date: Tue, 9 Nov 2021 23:29:43 +0330 Subject: [PATCH 1/7] Null coalescing assignment --- src/EasyCaching.Redis/DefaultRedisCachingProvider.Async.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EasyCaching.Redis/DefaultRedisCachingProvider.Async.cs b/src/EasyCaching.Redis/DefaultRedisCachingProvider.Async.cs index a09e7a59..89a7d137 100644 --- a/src/EasyCaching.Redis/DefaultRedisCachingProvider.Async.cs +++ b/src/EasyCaching.Redis/DefaultRedisCachingProvider.Async.cs @@ -366,7 +366,7 @@ public override async Task BaseGetExpirationAsync(string cacheKey) ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); var timeSpan = await _cache.KeyTimeToLiveAsync(cacheKey); - return timeSpan.HasValue ? timeSpan.Value : TimeSpan.Zero; + return timeSpan ?? TimeSpan.Zero; } } } From fce2176fc6bf7e982af2fc24a1b915c894dd9cde Mon Sep 17 00:00:00 2001 From: catcherwong Date: Mon, 27 Dec 2021 21:56:26 +0800 Subject: [PATCH 2/7] feat: upgradingdependencies --- appveyor.yml | 4 +- build/version.props | 40 ++++---- .../EasyCaching.Bus.CSRedis.csproj | 76 +++++++-------- .../EasyCaching.Bus.RabbitMQ.csproj | 79 ++++++++------- .../EasyCaching.Bus.Redis.csproj | 76 +++++++-------- ...t.Extensions.Caching.EasyCachingLib.csproj | 80 ++++++++-------- .../EasyCaching.Interceptor.AspectCore.csproj | 72 +++++++------- .../EasyCaching.Interceptor.Castle.csproj | 78 +++++++-------- .../EasyCaching.Demo.ConsoleApp.csproj | 2 +- .../EasyCaching.Demo.Interceptors.csproj | 2 +- .../EasyCaching.Demo.Providers.csproj | 2 +- .../EasyCaching.Demo.ResponseCaching.csproj | 2 +- .../EasyCaching.Serialization.Json.csproj | 78 +++++++-------- ...syCaching.Serialization.MessagePack.csproj | 70 +++++++------- .../EasyCaching.Serialization.Protobuf.csproj | 76 +++++++-------- ...aching.Serialization.SystemTextJson.csproj | 72 +++++++------- .../EasyCaching.CSRedis.csproj | 70 +++++++------- src/EasyCaching.Core/EasyCaching.Core.csproj | 78 ++++++++------- src/EasyCaching.Disk/EasyCaching.Disk.csproj | 78 +++++++-------- .../EasyCaching.HybridCache.csproj | 76 +++++++-------- .../EasyCaching.InMemory.csproj | 70 +++++++------- .../EasyCaching.LiteDB.csproj | 72 +++++++------- .../EasyCaching.Memcached.csproj | 70 +++++++------- .../EasyCaching.Redis.csproj | 70 +++++++------- .../EasyCaching.ResponseCaching.csproj | 66 ++++++------- .../EasyCaching.SQLite.csproj | 87 +++++++++-------- .../EasyCaching.PerformanceTests.csproj | 46 ++++----- .../EasyCaching.UnitTests.csproj | 95 +++++++++---------- .../SerializerTests/JsonSerializerTest.cs | 47 +++++++++ .../SystemTestJsonSerializerTest.cs | 4 +- 30 files changed, 900 insertions(+), 838 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c9ed67c9..085a0420 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ version: 1.0.{build} image: - Ubuntu1804 -- Visual Studio 2019 +- Visual Studio 2022 configuration: Release clone_depth: 50 @@ -27,7 +27,7 @@ for: - matrix: only: - - image: Visual Studio 2019 + - image: Visual Studio 2022 clone_folder: C:\projects\easycaching\ services: diff --git a/build/version.props b/build/version.props index bb654ad0..05037d68 100644 --- a/build/version.props +++ b/build/version.props @@ -1,24 +1,24 @@ - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 - 1.4.1 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 + 1.5.0 diff --git a/bus/EasyCaching.Bus.CSRedis/EasyCaching.Bus.CSRedis.csproj b/bus/EasyCaching.Bus.CSRedis/EasyCaching.Bus.CSRedis.csproj index 7907895d..bf1c4cf5 100644 --- a/bus/EasyCaching.Bus.CSRedis/EasyCaching.Bus.CSRedis.csproj +++ b/bus/EasyCaching.Bus.CSRedis/EasyCaching.Bus.CSRedis.csproj @@ -1,43 +1,43 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingCSRedisBusPackageVersion) - - - A simple caching bus(message bus) based on CSRedis. - - Bus,Hybrid,Redis,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingCSRedisBusPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingCSRedisBusPackageVersion) + + + A simple caching bus(message bus) based on CSRedis. + + Bus,Hybrid,Redis,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingCSRedisBusPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - - - - + + + + + + + + + diff --git a/bus/EasyCaching.Bus.RabbitMQ/EasyCaching.Bus.RabbitMQ.csproj b/bus/EasyCaching.Bus.RabbitMQ/EasyCaching.Bus.RabbitMQ.csproj index 60c7061f..9e2b6cf8 100644 --- a/bus/EasyCaching.Bus.RabbitMQ/EasyCaching.Bus.RabbitMQ.csproj +++ b/bus/EasyCaching.Bus.RabbitMQ/EasyCaching.Bus.RabbitMQ.csproj @@ -1,42 +1,49 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingRabbitBusPackageVersion) - - - A simple caching bus(message bus) based on RabbitMQ. - - Bus,Hybrid,RabbitMQ,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingRabbitBusPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingRabbitBusPackageVersion) + + + A simple caching bus(message bus) based on RabbitMQ. + + Bus,Hybrid,RabbitMQ,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingRabbitBusPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - + + + - - - - + + + + + + + + + + + diff --git a/bus/EasyCaching.Bus.Redis/EasyCaching.Bus.Redis.csproj b/bus/EasyCaching.Bus.Redis/EasyCaching.Bus.Redis.csproj index 022f2163..16674a4e 100644 --- a/bus/EasyCaching.Bus.Redis/EasyCaching.Bus.Redis.csproj +++ b/bus/EasyCaching.Bus.Redis/EasyCaching.Bus.Redis.csproj @@ -1,42 +1,42 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingRedisBusPackageVersion) - - - A simple caching bus(message bus) based on StackExchange.Redis. - - Bus,Hybrid,Redis,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingRedisBusPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingRedisBusPackageVersion) + + + A simple caching bus(message bus) based on StackExchange.Redis. + + Bus,Hybrid,Redis,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingRedisBusPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/extensions/Microsoft.Extensions.Caching.EasyCachingLib/Microsoft.Extensions.Caching.EasyCachingLib.csproj b/extensions/Microsoft.Extensions.Caching.EasyCachingLib/Microsoft.Extensions.Caching.EasyCachingLib.csproj index 7a6c12aa..8d8b4b9d 100644 --- a/extensions/Microsoft.Extensions.Caching.EasyCachingLib/Microsoft.Extensions.Caching.EasyCachingLib.csproj +++ b/extensions/Microsoft.Extensions.Caching.EasyCachingLib/Microsoft.Extensions.Caching.EasyCachingLib.csproj @@ -1,45 +1,45 @@ - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingMsExtPackageVersion) - - - EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier! - - Caching,Cache,Distributed - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - - + + + + netstandard2.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingMsExtPackageVersion) + + + EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier! + + Caching,Cache,Distributed + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj b/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj index 6183a21d..9170f032 100644 --- a/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj +++ b/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj @@ -1,41 +1,41 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingAspectCorePackageVersion) - - - A simple caching AOP extension library based on AspectCore - - Interceptor,AspectCore,AOP,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingAspectCorePackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingAspectCorePackageVersion) + + + A simple caching AOP extension library based on AspectCore + + Interceptor,AspectCore,AOP,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingAspectCorePackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - - + + + + + + + diff --git a/interceptor/EasyCaching.Interceptor.Castle/EasyCaching.Interceptor.Castle.csproj b/interceptor/EasyCaching.Interceptor.Castle/EasyCaching.Interceptor.Castle.csproj index 2835acdc..7a00ffb9 100644 --- a/interceptor/EasyCaching.Interceptor.Castle/EasyCaching.Interceptor.Castle.csproj +++ b/interceptor/EasyCaching.Interceptor.Castle/EasyCaching.Interceptor.Castle.csproj @@ -1,44 +1,44 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingCastlePackageVersion) - - - A simple caching AOP extension library based on Castle - - Interceptor,Castle,AOP,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingCastlePackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingCastlePackageVersion) + + + A simple caching AOP extension library based on Castle + + Interceptor,Castle,AOP,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingCastlePackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/sample/EasyCaching.Demo.ConsoleApp/EasyCaching.Demo.ConsoleApp.csproj b/sample/EasyCaching.Demo.ConsoleApp/EasyCaching.Demo.ConsoleApp.csproj index d3c42c58..91b6c494 100644 --- a/sample/EasyCaching.Demo.ConsoleApp/EasyCaching.Demo.ConsoleApp.csproj +++ b/sample/EasyCaching.Demo.ConsoleApp/EasyCaching.Demo.ConsoleApp.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 false diff --git a/sample/EasyCaching.Demo.Interceptors/EasyCaching.Demo.Interceptors.csproj b/sample/EasyCaching.Demo.Interceptors/EasyCaching.Demo.Interceptors.csproj index c940b6f8..1e5c66d0 100644 --- a/sample/EasyCaching.Demo.Interceptors/EasyCaching.Demo.Interceptors.csproj +++ b/sample/EasyCaching.Demo.Interceptors/EasyCaching.Demo.Interceptors.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/sample/EasyCaching.Demo.Providers/EasyCaching.Demo.Providers.csproj b/sample/EasyCaching.Demo.Providers/EasyCaching.Demo.Providers.csproj index 20bf68ca..f9afa091 100644 --- a/sample/EasyCaching.Demo.Providers/EasyCaching.Demo.Providers.csproj +++ b/sample/EasyCaching.Demo.Providers/EasyCaching.Demo.Providers.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/sample/EasyCaching.Demo.ResponseCaching/EasyCaching.Demo.ResponseCaching.csproj b/sample/EasyCaching.Demo.ResponseCaching/EasyCaching.Demo.ResponseCaching.csproj index ee77c04c..78fb4c0e 100644 --- a/sample/EasyCaching.Demo.ResponseCaching/EasyCaching.Demo.ResponseCaching.csproj +++ b/sample/EasyCaching.Demo.ResponseCaching/EasyCaching.Demo.ResponseCaching.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/serialization/EasyCaching.Serialization.Json/EasyCaching.Serialization.Json.csproj b/serialization/EasyCaching.Serialization.Json/EasyCaching.Serialization.Json.csproj index e9320026..8d84a143 100644 --- a/serialization/EasyCaching.Serialization.Json/EasyCaching.Serialization.Json.csproj +++ b/serialization/EasyCaching.Serialization.Json/EasyCaching.Serialization.Json.csproj @@ -1,43 +1,43 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingJsonPackageVersion) - - - A serialize library based on Newtonsoft.Json - - Caching,Serialization,Json - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingJsonPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingJsonPackageVersion) + + + A serialize library based on Newtonsoft.Json + + Caching,Serialization,Json + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingJsonPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/serialization/EasyCaching.Serialization.MessagePack/EasyCaching.Serialization.MessagePack.csproj b/serialization/EasyCaching.Serialization.MessagePack/EasyCaching.Serialization.MessagePack.csproj index a00b7683..4584dc3e 100644 --- a/serialization/EasyCaching.Serialization.MessagePack/EasyCaching.Serialization.MessagePack.csproj +++ b/serialization/EasyCaching.Serialization.MessagePack/EasyCaching.Serialization.MessagePack.csproj @@ -1,40 +1,40 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingMessagePackPackageVersion) - - - A serialize library based on MessagePack - - Caching,Serialization,MessagePack - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingMessagePackPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingMessagePackPackageVersion) + + + A serialize library based on MessagePack + + Caching,Serialization,MessagePack + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingMessagePackPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - + + + + + + diff --git a/serialization/EasyCaching.Serialization.Protobuf/EasyCaching.Serialization.Protobuf.csproj b/serialization/EasyCaching.Serialization.Protobuf/EasyCaching.Serialization.Protobuf.csproj index 36e4e1f5..ea1dbfaa 100644 --- a/serialization/EasyCaching.Serialization.Protobuf/EasyCaching.Serialization.Protobuf.csproj +++ b/serialization/EasyCaching.Serialization.Protobuf/EasyCaching.Serialization.Protobuf.csproj @@ -1,43 +1,43 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingProtobufPackageVersion) - - - A serialize library based on protobuf-net - - Caching,Serialization,Protobuf - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingProtobufPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingProtobufPackageVersion) + + + A serialize library based on protobuf-net + + Caching,Serialization,Protobuf + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingProtobufPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - - - - + + + + + + + + + diff --git a/serialization/EasyCaching.Serialization.SystemTextJson/EasyCaching.Serialization.SystemTextJson.csproj b/serialization/EasyCaching.Serialization.SystemTextJson/EasyCaching.Serialization.SystemTextJson.csproj index 9589b461..7769db49 100644 --- a/serialization/EasyCaching.Serialization.SystemTextJson/EasyCaching.Serialization.SystemTextJson.csproj +++ b/serialization/EasyCaching.Serialization.SystemTextJson/EasyCaching.Serialization.SystemTextJson.csproj @@ -1,40 +1,40 @@ - - - - netstandard2.0 - EasyCaching Contributors - $(EasyCachingSTJsonPackageVersion) - - - A serialize library based on System.Text.Json - - Caching,Serialization,Json - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingSTJsonPackageNotes) - - + + + + netstandard2.0;net6.0 + EasyCaching Contributors + $(EasyCachingSTJsonPackageVersion) + + + A serialize library based on System.Text.Json + + Caching,Serialization,Json + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingSTJsonPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj b/src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj index bb0eedb6..e589aa4d 100644 --- a/src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj +++ b/src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj @@ -1,40 +1,40 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingCSRedisPackageVersion) - - - A simple distributed caching provider based on csredis. - - Redis,DistributedCache,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingCSRedisPackageVersion) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingCSRedisPackageVersion) + + + A simple distributed caching provider based on csredis. + + Redis,DistributedCache,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingCSRedisPackageVersion) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - + + + + + + diff --git a/src/EasyCaching.Core/EasyCaching.Core.csproj b/src/EasyCaching.Core/EasyCaching.Core.csproj index 5a066276..4e348f6b 100644 --- a/src/EasyCaching.Core/EasyCaching.Core.csproj +++ b/src/EasyCaching.Core/EasyCaching.Core.csproj @@ -1,40 +1,48 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingCorePackageVersion) - - - EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier! - - Caching,Cache,Distributed,Memory,Interceptor,Hybrid,ResponseCaching - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingCorePackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingCorePackageVersion) + + + EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier! + + Caching,Cache,Distributed,Memory,Interceptor,Hybrid,ResponseCaching + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingCorePackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - + + + + + + + + + + + + + + diff --git a/src/EasyCaching.Disk/EasyCaching.Disk.csproj b/src/EasyCaching.Disk/EasyCaching.Disk.csproj index af5c0bf7..c466fb45 100644 --- a/src/EasyCaching.Disk/EasyCaching.Disk.csproj +++ b/src/EasyCaching.Disk/EasyCaching.Disk.csproj @@ -1,45 +1,45 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingDiskPackageVersion) - - - A simple disk(file) caching provider. - - Disk,File,LocalCache,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingDiskPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingDiskPackageVersion) + + + A simple disk(file) caching provider. + + Disk,File,LocalCache,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingDiskPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - + + + - - - - - - - + + + + + + + diff --git a/src/EasyCaching.HybridCache/EasyCaching.HybridCache.csproj b/src/EasyCaching.HybridCache/EasyCaching.HybridCache.csproj index b015e945..6b6d4436 100644 --- a/src/EasyCaching.HybridCache/EasyCaching.HybridCache.csproj +++ b/src/EasyCaching.HybridCache/EasyCaching.HybridCache.csproj @@ -1,44 +1,44 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingHybridPackageVersion) - - - A simple hybrid caching provider combines local caching and distributed caching. - - Hybrid,Synchronization,LocalCache,DistributedCache,Caching - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingHybridPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingHybridPackageVersion) + + + A simple hybrid caching provider combines local caching and distributed caching. + + Hybrid,Synchronization,LocalCache,DistributedCache,Caching + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingHybridPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - + + + - - - - - - + + + + + + diff --git a/src/EasyCaching.InMemory/EasyCaching.InMemory.csproj b/src/EasyCaching.InMemory/EasyCaching.InMemory.csproj index f02d2658..2d1dd05d 100644 --- a/src/EasyCaching.InMemory/EasyCaching.InMemory.csproj +++ b/src/EasyCaching.InMemory/EasyCaching.InMemory.csproj @@ -1,41 +1,41 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingInMemoryPackageVersion) - - - A simple in-memory caching provider. - - In-Memory,LocalCache,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingInMemoryPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingInMemoryPackageVersion) + + + A simple in-memory caching provider. + + In-Memory,LocalCache,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingInMemoryPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - + + + - - - + + + diff --git a/src/EasyCaching.LiteDB/EasyCaching.LiteDB.csproj b/src/EasyCaching.LiteDB/EasyCaching.LiteDB.csproj index 9f14e7b0..90a65259 100644 --- a/src/EasyCaching.LiteDB/EasyCaching.LiteDB.csproj +++ b/src/EasyCaching.LiteDB/EasyCaching.LiteDB.csproj @@ -1,41 +1,41 @@  - - - - netstandard2.0 - maikebing - maikebing - $(EasyCachingLiteDBPackageVersion) - - A simple local caching provider based on LiteDB - LiteDB,LocalCache,Caching,Cache,InMemory,Persisted - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingLiteDBPackageNotes) - - + + + + netstandard2.0;net6.0 + maikebing + maikebing + $(EasyCachingLiteDBPackageVersion) + + A simple local caching provider based on LiteDB + LiteDB,LocalCache,Caching,Cache,InMemory,Persisted + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingLiteDBPackageNotes) + + - - true - $(NoWarn);1591 - maikebing - + + true + $(NoWarn);1591 + maikebing + - - - - + + + + - - - - - - - - + + + + + + + + diff --git a/src/EasyCaching.Memcached/EasyCaching.Memcached.csproj b/src/EasyCaching.Memcached/EasyCaching.Memcached.csproj index 576c9982..fccb6f1f 100644 --- a/src/EasyCaching.Memcached/EasyCaching.Memcached.csproj +++ b/src/EasyCaching.Memcached/EasyCaching.Memcached.csproj @@ -1,40 +1,40 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingMemcachedPackageVersion) - - - A simple distributed caching provider based on EnyimMemcachedCore. - - Memcached,DistributedCache,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingMemcachedPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingMemcachedPackageVersion) + + + A simple distributed caching provider based on EnyimMemcachedCore. + + Memcached,DistributedCache,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingMemcachedPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - + + + + + + diff --git a/src/EasyCaching.Redis/EasyCaching.Redis.csproj b/src/EasyCaching.Redis/EasyCaching.Redis.csproj index 02b9e836..292d88e9 100644 --- a/src/EasyCaching.Redis/EasyCaching.Redis.csproj +++ b/src/EasyCaching.Redis/EasyCaching.Redis.csproj @@ -1,40 +1,40 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingRedisPackageVersion) - - - A simple distributed caching provider based on StackExchange.Redis. - - Redis,DistributedCache,Caching,Cache - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingRedisPackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingRedisPackageVersion) + + + A simple distributed caching provider based on StackExchange.Redis. + + Redis,DistributedCache,Caching,Cache + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingRedisPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - + + + + + + diff --git a/src/EasyCaching.ResponseCaching/EasyCaching.ResponseCaching.csproj b/src/EasyCaching.ResponseCaching/EasyCaching.ResponseCaching.csproj index 7e7c6e11..085c7cf7 100644 --- a/src/EasyCaching.ResponseCaching/EasyCaching.ResponseCaching.csproj +++ b/src/EasyCaching.ResponseCaching/EasyCaching.ResponseCaching.csproj @@ -1,38 +1,38 @@  - - - - netcoreapp3.1 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingResponseCachingPackageVersion) - - - EasyCaching.ResponseCaching is the extension of ResponseCaching - - Caching,Cache,ResponseCaching - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingResponseCachingPackageNotes) - - + + + + netcoreapp3.1 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingResponseCachingPackageVersion) + + + EasyCaching.ResponseCaching is the extension of ResponseCaching + + Caching,Cache,ResponseCaching + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingResponseCachingPackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - + + + + diff --git a/src/EasyCaching.SQLite/EasyCaching.SQLite.csproj b/src/EasyCaching.SQLite/EasyCaching.SQLite.csproj index 4545f515..e789a836 100644 --- a/src/EasyCaching.SQLite/EasyCaching.SQLite.csproj +++ b/src/EasyCaching.SQLite/EasyCaching.SQLite.csproj @@ -1,46 +1,51 @@  - - - - netstandard2.0 - ncc;Catcher Wong - ncc;Catcher Wong - $(EasyCachingSQLitePackageVersion) - - - A simple local caching provider based on Microsoft.Data.SQLite - - SQLite,LocalCache,Caching,Cache,InMemory,Persisted - https://github.com/dotnetcore/EasyCaching - LICENSE - https://github.com/dotnetcore/EasyCaching - https://github.com/dotnetcore/EasyCaching - nuget-icon.png - - $(EasyCachingSQLitePackageNotes) - - + + + + netstandard2.0;net6.0 + ncc;Catcher Wong + ncc;Catcher Wong + $(EasyCachingSQLitePackageVersion) + + + A simple local caching provider based on Microsoft.Data.SQLite + + SQLite,LocalCache,Caching,Cache,InMemory,Persisted + https://github.com/dotnetcore/EasyCaching + LICENSE + https://github.com/dotnetcore/EasyCaching + https://github.com/dotnetcore/EasyCaching + nuget-icon.png + + $(EasyCachingSQLitePackageNotes) + + - - true - $(NoWarn);1591 - + + true + $(NoWarn);1591 + - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/test/EasyCaching.PerformanceTests/EasyCaching.PerformanceTests.csproj b/test/EasyCaching.PerformanceTests/EasyCaching.PerformanceTests.csproj index ff3d16d6..3197bf99 100644 --- a/test/EasyCaching.PerformanceTests/EasyCaching.PerformanceTests.csproj +++ b/test/EasyCaching.PerformanceTests/EasyCaching.PerformanceTests.csproj @@ -1,28 +1,28 @@  - - Exe - netcoreapp3.1 - false - + + Exe + net6.0 + false + - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj b/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj index 24533c83..e86532c4 100644 --- a/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj +++ b/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj @@ -1,58 +1,53 @@  - - netcoreapp3.1 + + net6.0 - false - + false + - - - + + + - - - Always - - + + + Always + + - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/test/EasyCaching.UnitTests/SerializerTests/JsonSerializerTest.cs b/test/EasyCaching.UnitTests/SerializerTests/JsonSerializerTest.cs index a0627626..c03832be 100644 --- a/test/EasyCaching.UnitTests/SerializerTests/JsonSerializerTest.cs +++ b/test/EasyCaching.UnitTests/SerializerTests/JsonSerializerTest.cs @@ -4,6 +4,8 @@ using FakeItEasy; using Microsoft.Extensions.Options; using Newtonsoft.Json; + using System; + using System.Collections.Generic; using Xunit; public class JsonSerializerTest : BaseSerializerTest @@ -66,5 +68,50 @@ public void NullValueHandling_Test_Should_Succeed() Assert.Null(joe.Manager); } + +#if NET6_0 + [Fact] + public void DateOnly_Iss338_Test_Should_Succeed() + { + var serializer = new DefaultJsonSerializer("json", new JsonSerializerSettings() + { + NullValueHandling = NullValueHandling.Ignore, + Converters = new List() { new DateOnlyJsonConverter()} + }); + + var dateTime = DateTime.Parse("2021-12-21 12:12:12"); + var date = DateOnly.FromDateTime(dateTime); + + DateOnlyModel m = new DateOnlyModel { Name = "Joe User", Date = date }; + + var @byte = serializer.Serialize(m); + var @obj = serializer.Deserialize(@byte); + + Assert.Equal(date, obj.Date); + } + + public class DateOnlyModel + { + public string Name { get; set; } + + public DateOnly Date { get; set; } + } + + + public sealed class DateOnlyJsonConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, DateOnly value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString("O")); + } + + public override DateOnly ReadJson(JsonReader reader, Type objectType, DateOnly existingValue, bool hasExistingValue, + JsonSerializer serializer) + { + //return DateOnly.FromDateTime(reader.ReadAsDateTime().Value); + return DateOnly.ParseExact((string)reader.Value, "yyyy-MM-dd"); + } + } +#endif } } diff --git a/test/EasyCaching.UnitTests/SerializerTests/SystemTestJsonSerializerTest.cs b/test/EasyCaching.UnitTests/SerializerTests/SystemTestJsonSerializerTest.cs index 38db6210..5066c176 100644 --- a/test/EasyCaching.UnitTests/SerializerTests/SystemTestJsonSerializerTest.cs +++ b/test/EasyCaching.UnitTests/SerializerTests/SystemTestJsonSerializerTest.cs @@ -58,8 +58,8 @@ public void NullValueHandling_Test_Should_Succeed() { var serializer = new DefaultJsonSerializer("json", new JsonSerializerOptions { - IgnoreNullValues = true - }); + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull + }) ; Employee joe = new Employee { Name = "Joe User" }; From 0a771aa853bb4eebcbd5b85480fd2755f474c8fc Mon Sep 17 00:00:00 2001 From: catcherwong Date: Mon, 27 Dec 2021 22:23:19 +0800 Subject: [PATCH 3/7] chore: windows docker --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 085a0420..206f46e5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,6 +34,8 @@ for: - docker before_build: + - ps: cd "C:\Program Files\Docker\Docker" + - ps: ./DockerCli.exe -SwitchDaemon - ps: docker pull redis - ps: docker pull bitnami/memcached:latest - ps: docker run -p 6379:6379 --name redis6379 -d redis:latest From 60bc4ec20af10270f37724dc1dcb747162d9bcbc Mon Sep 17 00:00:00 2001 From: catcherwong Date: Mon, 27 Dec 2021 22:36:35 +0800 Subject: [PATCH 4/7] chore: fix build --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 206f46e5..76b04345 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,6 +36,7 @@ for: before_build: - ps: cd "C:\Program Files\Docker\Docker" - ps: ./DockerCli.exe -SwitchDaemon + - ps: cd C:\projects\easycaching\ - ps: docker pull redis - ps: docker pull bitnami/memcached:latest - ps: docker run -p 6379:6379 --name redis6379 -d redis:latest From 38d5a20b14ad108bb15a8d106a2d5ef94cfee3fa Mon Sep 17 00:00:00 2001 From: catcherwong Date: Sun, 23 Jan 2022 11:22:12 +0800 Subject: [PATCH 5/7] chore: github action --- .github/workflows/build.yml | 85 +++++++++++++++++++++++++++++++++++++ .travis.yml | 34 --------------- README.md | 3 +- appveyor.yml | 76 --------------------------------- 4 files changed, 86 insertions(+), 112 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..ff55ff3e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,85 @@ +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 ] + + services: + redis6379: + image: redis + ports: + - 6379:6379 + redis6380: + image: redis + ports: + - 6380:6379 + redis6388: + image: redis + ports: + - 6388:6379 + memcached1: + image: bitnami/memcached + ports: + - 11211:11211 + memcached2: + image: bitnami/memcached + ports: + - 11212:11211 + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET SDK 6.0.x + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 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/EasyCaching/EasyCaching/EasyCaching.sln + + - name: Run tests on net6.0 + run: | + dotnet test --framework=net6.0 /home/runner/work/EasyCaching/EasyCaching/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj + + 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 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 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\EasyCaching\EasyCaching\EasyCaching.sln \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3bb8cd1b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: csharp -solution: EasyCaching.sln -dist: bionic -sudo: required -dotnet: 3.1.100 -mono: none - -services: - - docker - -os: - - linux - - osx - -osx_image: xcode9.4 - -branches: - only: - - master - - dev - -script: - # osx do not support docker - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker pull redis; fi - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker pull memcached; fi - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker run -p 6379:6379 --name redis6379 -d redis:latest redis-server; fi - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker run -p 6380:6379 --name redis6380 -d redis:latest redis-server; fi - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker run -p 6388:6379 --name redis6388 -d redis:latest redis-server; fi - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker run -p 11211:11211 --name memcached1 -d memcached:latest memcached -m 64 -c 2048; fi - # - if test "$TRAVIS_OS_NAME" == "linux"; then docker run -p 11212:11211 --name memcached2 -d memcached:latest memcached -m 64 -c 2048; fi - - export PATH="$PATH:$HOME/.dotnet/tools" - - dotnet tool install --global FlubuCore.GlobalTool --version 5.0.4 - - flubu build -s=build/BuildScript.cs - # - if test "$TRAVIS_OS_NAME" == "linux"; then dotnet test -c Release --no-build ./test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj; fi diff --git a/README.md b/README.md index 8cce2d75..cc2bd8d4 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ EasyCaching is an open source caching library that contains basic usages and som | Platform | Build Server | Master Status | Dev Status | |--------- |------------- |---------|---------| -| AppVeyor | Windows/Linux |[![Build status](https://ci.appveyor.com/api/projects/status/4x6qal9c1r10wn6x/branch/master?svg=true)](https://ci.appveyor.com/project/catcherwong/easycaching-48okb/branch/master) |[![Build status](https://ci.appveyor.com/api/projects/status/4x6qal9c1r10wn6x/branch/dev?svg=true)](https://ci.appveyor.com/project/catcherwong/easycaching-48okb/branch/dev)| -| Travis | Linux/OSX | [![Build Status](https://travis-ci.org/dotnetcore/EasyCaching.svg?branch=master)](https://travis-ci.org/dotnetcore/EasyCaching) | [![Build Status](https://travis-ci.org/dotnetcore/EasyCaching.svg?branch=dev)](https://travis-ci.org/dotnetcore/EasyCaching) | +| Github Action | Linux/Windows | [![Build&Test](https://github.com/dotnetcore/EasyCaching/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/dotnetcore/EasyCaching/actions/workflows/build.yml) | [![Build&Test](https://github.com/dotnetcore/EasyCaching/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/dotnetcore/EasyCaching/actions/workflows/build.yml) | ## Nuget Packages diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 76b04345..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,76 +0,0 @@ -version: 1.0.{build} -image: -- Ubuntu1804 -- Visual Studio 2022 -configuration: Release -clone_depth: 50 - -environment: - api_key: - secure: uLmHVukKUWd0jiGGi3V1V9eomr8hCLB75dYvr1BkO0piqqIkuIF+fB/gwVWJ0zYQ - -pull_requests: - do_not_increment_build_number: true - -#skip_branch_with_pr: true -skip_commits: - files: - - docs/* - - media/* - - LICENSE - - mkdocs.yml - - README.md - - .travis.yml - - .gitignore - -for: -- - matrix: - only: - - image: Visual Studio 2022 - clone_folder: C:\projects\easycaching\ - - services: - - docker - - before_build: - - ps: cd "C:\Program Files\Docker\Docker" - - ps: ./DockerCli.exe -SwitchDaemon - - ps: cd C:\projects\easycaching\ - - ps: docker pull redis - - ps: docker pull bitnami/memcached:latest - - ps: docker run -p 6379:6379 --name redis6379 -d redis:latest - - ps: docker run -p 6380:6379 --name redis6380 -d redis:latest - - ps: docker run -p 6388:6379 --name redis6388 -d redis:latest - - ps: docker run -p 11211:11211 --name memcached1 -d bitnami/memcached:latest - - ps: docker run -p 11212:11211 --name memcached2 -d bitnami/memcached:latest - - ps: docker ps -a - - ps: dotnet tool install --global FlubuCore.GlobalTool --version 5.0.4 - - build_script: - - ps: flubu Rebuild.Server -apiKey=$env:api_key - -- - matrix: - only: - - image: Ubuntu1804 - - clone_folder: /home/appveyor/projects/easycaching - - services: - - docker - - before_build: - - sh: docker pull redis - - sh: docker pull memcached - - sh: docker run -p 6379:6379 --name redis6379 -d redis:latest redis-server - - sh: docker run -p 6380:6379 --name redis6380 -d redis:latest redis-server - - sh: docker run -p 6388:6379 --name redis6388 -d redis:latest redis-server - - sh: docker run -p 11211:11211 --name memcached1 -d memcached memcached -m 64 -c 2048 - - sh: docker run -p 11212:11211 --name memcached2 -d memcached memcached -m 64 -c 2048 - - sh: docker ps -a - - sh: dotnet tool install --global FlubuCore.GlobalTool --version 5.0.4 - - build_script: - - sh: flubu Rebuild -s=build/BuildScript.cs - From cb0bb2fbde9ed31d23ebdf6789acbd58452e1712 Mon Sep 17 00:00:00 2001 From: catcherwong Date: Sun, 23 Jan 2022 11:35:40 +0800 Subject: [PATCH 6/7] chore: release using net 6 --- .github/workflows/release.yml | 3 ++- .github/workflows/release_stable.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0c2316f..1f4c9e23 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,7 @@ on: branches: - dev - master + - main jobs: build_artifact: @@ -16,7 +17,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.200 + dotnet-version: 6.0.x - name: Build with dotnet run: dotnet build --configuration Release /home/runner/work/EasyCaching/EasyCaching/EasyCaching.sln - name: Pack with dotnet diff --git a/.github/workflows/release_stable.yml b/.github/workflows/release_stable.yml index f0846d1e..cb7a7eca 100644 --- a/.github/workflows/release_stable.yml +++ b/.github/workflows/release_stable.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.200 + dotnet-version: 6.0.x - name: Build with dotnet run: dotnet build --configuration Release /home/runner/work/EasyCaching/EasyCaching/EasyCaching.sln - name: Pack with dotnet From 45f60672ed649e9c18b661ab5de55fb5403f9b09 Mon Sep 17 00:00:00 2001 From: catcherwong Date: Sun, 23 Jan 2022 11:42:49 +0800 Subject: [PATCH 7/7] chore: split windows and linux --- .github/workflows/build.yml | 57 +-------------------------- .github/workflows/buildandtest.yml | 62 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/buildandtest.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff55ff3e..ad85ec95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build&Test +name: Build on: push: @@ -7,60 +7,7 @@ on: branches: [ dev, main, master ] jobs: - - linux: - name: build and test on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest ] - - services: - redis6379: - image: redis - ports: - - 6379:6379 - redis6380: - image: redis - ports: - - 6380:6379 - redis6388: - image: redis - ports: - - 6388:6379 - memcached1: - image: bitnami/memcached - ports: - - 11211:11211 - memcached2: - image: bitnami/memcached - ports: - - 11212:11211 - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET SDK 6.0.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 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/EasyCaching/EasyCaching/EasyCaching.sln - - - name: Run tests on net6.0 - run: | - dotnet test --framework=net6.0 /home/runner/work/EasyCaching/EasyCaching/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj - + windows: name: build on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/.github/workflows/buildandtest.yml b/.github/workflows/buildandtest.yml new file mode 100644 index 00000000..fb79d718 --- /dev/null +++ b/.github/workflows/buildandtest.yml @@ -0,0 +1,62 @@ +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 ] + + services: + redis6379: + image: redis + ports: + - 6379:6379 + redis6380: + image: redis + ports: + - 6380:6379 + redis6388: + image: redis + ports: + - 6388:6379 + memcached1: + image: bitnami/memcached + ports: + - 11211:11211 + memcached2: + image: bitnami/memcached + ports: + - 11212:11211 + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET SDK 6.0.x + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 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/EasyCaching/EasyCaching/EasyCaching.sln + + - name: Run tests on net6.0 + run: | + dotnet test --framework=net6.0 /home/runner/work/EasyCaching/EasyCaching/test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj