Skip to content

Commit

Permalink
Merge pull request #13 from catcherwong/feat/net6
Browse files Browse the repository at this point in the history
feat: support newest lts net6.0
  • Loading branch information
yedf2 authored Jan 20, 2022
2 parents c0c90d8 + d2b3626 commit 2cb6266
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 39 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
name: Build
name: Build_And_Test

on:
push:
branches: [ dev, main ]
branches: [ dev, main, 'feat/**' ]
pull_request:
branches: [ dev, main ]

jobs:

linux:
name: build on linux
runs-on: ubuntu-latest

name: build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]

steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- uses: actions/checkout@v2
- name: Setup .NET SDK 6.0.x
uses: actions/[email protected]
with:
dotnet-version: 6.0.x

- name: Setup .NET SDK 5.0.x
uses: actions/[email protected]
with:
dotnet-version: 5.0.x

- name: Setup .NET SDK 3.1.x
uses: actions/[email protected]
with:
dotnet-version: 5.0.x
dotnet-version: 3.1.x

- name: Show dotnet Version
run: dotnet --version
- name: Build with dotnet
run: |
dotnet build --configuration Release --source https://api.nuget.org/v3/index.json src/Dtmcli/Dtmcli.csproj
dotnet build --configuration Release --source https://api.nuget.org/v3/index.json src/Dtmcli.Tests/Dtmcli.Tests.csproj
- name: Test with dotnet
dotnet --list-sdks
dotnet --list-runtimes
- name: Build with dotnet
run: |
dotnet build src/Dtmcli/Dtmcli.csproj
- name: Run tests on netcoreapp3.1
run: |
dotnet test --framework=netcoreapp3.1 src/Dtmcli.Tests/Dtmcli.Tests.csproj
- name: Run tests on net5.0
run: |
dotnet test --framework=net5.0 src/Dtmcli.Tests/Dtmcli.Tests.csproj
- name: Run tests on net6.0
run: |
dotnet test src/Dtmcli.Tests/Dtmcli.Tests.csproj --no-restore
dotnet test --framework=net6.0 src/Dtmcli.Tests/Dtmcli.Tests.csproj
2 changes: 1 addition & 1 deletion .github/workflows/release_unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x
- name: Build with dotnet
run: |
dotnet build --configuration Release --source https://api.nuget.org/v3/index.json src/Dtmcli/Dtmcli.csproj
Expand Down
4 changes: 2 additions & 2 deletions src/Dtmcli.Tests/Dtmcli.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<!--<Nullable>enable</Nullable>-->

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DbMocker" Version="1.21.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
Expand Down
2 changes: 1 addition & 1 deletion src/Dtmcli.Tests/SagaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public SageMockHttpMessageHandler()

protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var str = await request.Content?.ReadAsStringAsync(cancellationToken) ?? "";
var str = await request.Content?.ReadAsStringAsync() ?? "";

var transBase = System.Text.Json.JsonSerializer.Deserialize<DtmImp.TransBase>(str);

Expand Down
57 changes: 37 additions & 20 deletions src/Dtmcli/Dtmcli.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<PackageProjectUrl>https://github.com/dtm-labs/dtmcli-csharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/dtm-labs/dtmcli-csharp</RepositoryUrl>
<AssemblyName>Dtmcli</AssemblyName>
<RootNamespace>Dtmcli</RootNamespace>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<VersionPrefix>0.3.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>geffzhang</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<PackageProjectUrl>https://github.com/dtm-labs/dtmcli-csharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/dtm-labs/dtmcli-csharp</RepositoryUrl>
<AssemblyName>Dtmcli</AssemblyName>
<RootNamespace>Dtmcli</RootNamespace>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<VersionPrefix>0.3.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>geffzhang</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="System.Text.Json" Version="6.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
</ItemGroup>

</Project>

0 comments on commit 2cb6266

Please sign in to comment.