Skip to content

Commit 2cb6266

Browse files
authored
Merge pull request #13 from catcherwong/feat/net6
feat: support newest lts net6.0
2 parents c0c90d8 + d2b3626 commit 2cb6266

File tree

5 files changed

+81
-39
lines changed

5 files changed

+81
-39
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,54 @@
1-
name: Build
1+
name: Build_And_Test
22

33
on:
44
push:
5-
branches: [ dev, main ]
5+
branches: [ dev, main, 'feat/**' ]
66
pull_request:
77
branches: [ dev, main ]
88

99
jobs:
1010

1111
linux:
12-
name: build on linux
13-
runs-on: ubuntu-latest
14-
12+
name: build on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ windows-latest, ubuntu-latest ]
17+
1518
steps:
16-
- uses: actions/checkout@v1
17-
- name: Setup .NET Core
18-
uses: actions/setup-dotnet@v1
19+
- uses: actions/checkout@v2
20+
- name: Setup .NET SDK 6.0.x
21+
uses: actions/[email protected]
22+
with:
23+
dotnet-version: 6.0.x
24+
25+
- name: Setup .NET SDK 5.0.x
26+
uses: actions/[email protected]
27+
with:
28+
dotnet-version: 5.0.x
29+
30+
- name: Setup .NET SDK 3.1.x
31+
uses: actions/[email protected]
1932
with:
20-
dotnet-version: 5.0.x
33+
dotnet-version: 3.1.x
34+
2135
- name: Show dotnet Version
22-
run: dotnet --version
23-
- name: Build with dotnet
2436
run: |
25-
dotnet build --configuration Release --source https://api.nuget.org/v3/index.json src/Dtmcli/Dtmcli.csproj
26-
dotnet build --configuration Release --source https://api.nuget.org/v3/index.json src/Dtmcli.Tests/Dtmcli.Tests.csproj
27-
- name: Test with dotnet
37+
dotnet --list-sdks
38+
dotnet --list-runtimes
39+
40+
- name: Build with dotnet
41+
run: |
42+
dotnet build src/Dtmcli/Dtmcli.csproj
43+
44+
- name: Run tests on netcoreapp3.1
45+
run: |
46+
dotnet test --framework=netcoreapp3.1 src/Dtmcli.Tests/Dtmcli.Tests.csproj
47+
48+
- name: Run tests on net5.0
49+
run: |
50+
dotnet test --framework=net5.0 src/Dtmcli.Tests/Dtmcli.Tests.csproj
51+
52+
- name: Run tests on net6.0
2853
run: |
29-
dotnet test src/Dtmcli.Tests/Dtmcli.Tests.csproj --no-restore
54+
dotnet test --framework=net6.0 src/Dtmcli.Tests/Dtmcli.Tests.csproj

.github/workflows/release_unstable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup .NET Core
1616
uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: 5.0.x
18+
dotnet-version: 6.0.x
1919
- name: Build with dotnet
2020
run: |
2121
dotnet build --configuration Release --source https://api.nuget.org/v3/index.json src/Dtmcli/Dtmcli.csproj

src/Dtmcli.Tests/Dtmcli.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
55
<!--<Nullable>enable</Nullable>-->
66

77
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<PackageReference Include="DbMocker" Version="1.21.0" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1313
<PackageReference Include="Moq" Version="4.16.1" />
1414
<PackageReference Include="xunit" Version="2.4.1" />
1515
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">

src/Dtmcli.Tests/SagaTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public SageMockHttpMessageHandler()
4545

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

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

src/Dtmcli/Dtmcli.csproj

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
5-
<PackageProjectUrl>https://github.com/dtm-labs/dtmcli-csharp</PackageProjectUrl>
6-
<RepositoryUrl>https://github.com/dtm-labs/dtmcli-csharp</RepositoryUrl>
7-
<AssemblyName>Dtmcli</AssemblyName>
8-
<RootNamespace>Dtmcli</RootNamespace>
9-
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
10-
<VersionPrefix>0.3.0</VersionPrefix>
11-
<VersionSuffix></VersionSuffix>
12-
<Authors>geffzhang</Authors>
13-
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
14-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
15-
</PropertyGroup>
16-
17-
<ItemGroup>
18-
<PackageReference Include="Dapper" Version="2.0.123" />
19-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
20-
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
21-
<PackageReference Include="System.Text.Json" Version="5.0.2" />
22-
</ItemGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
5+
<PackageProjectUrl>https://github.com/dtm-labs/dtmcli-csharp</PackageProjectUrl>
6+
<RepositoryUrl>https://github.com/dtm-labs/dtmcli-csharp</RepositoryUrl>
7+
<AssemblyName>Dtmcli</AssemblyName>
8+
<RootNamespace>Dtmcli</RootNamespace>
9+
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
10+
<VersionPrefix>0.3.0</VersionPrefix>
11+
<VersionSuffix></VersionSuffix>
12+
<Authors>geffzhang</Authors>
13+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
14+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Dapper" Version="2.0.123" />
19+
<PackageReference Include="System.Text.Json" Version="6.0.1" />
20+
</ItemGroup>
21+
22+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
23+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
24+
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
25+
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
26+
</ItemGroup>
27+
28+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
29+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
30+
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
31+
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
32+
</ItemGroup>
33+
34+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
35+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
36+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
37+
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
38+
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
39+
</ItemGroup>
2340

2441
</Project>

0 commit comments

Comments
 (0)