diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f826915..0fd6454 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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/setup-dotnet@v1.7.2 + with: + dotnet-version: 6.0.x + + - name: Setup .NET SDK 5.0.x + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: 5.0.x + + - name: Setup .NET SDK 3.1.x + uses: actions/setup-dotnet@v1.7.2 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 \ No newline at end of file diff --git a/.github/workflows/release_unstable.yml b/.github/workflows/release_unstable.yml index 54c951b..a19b4cd 100644 --- a/.github/workflows/release_unstable.yml +++ b/.github/workflows/release_unstable.yml @@ -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 diff --git a/src/Dtmcli.Tests/Dtmcli.Tests.csproj b/src/Dtmcli.Tests/Dtmcli.Tests.csproj index 7cac13e..3093033 100644 --- a/src/Dtmcli.Tests/Dtmcli.Tests.csproj +++ b/src/Dtmcli.Tests/Dtmcli.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + netcoreapp3.1;net5.0;net6.0 false @@ -9,7 +9,7 @@ - + diff --git a/src/Dtmcli.Tests/SagaTests.cs b/src/Dtmcli.Tests/SagaTests.cs index 7cfe9d8..cd7d287 100644 --- a/src/Dtmcli.Tests/SagaTests.cs +++ b/src/Dtmcli.Tests/SagaTests.cs @@ -45,7 +45,7 @@ public SageMockHttpMessageHandler() protected override async Task 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(str); diff --git a/src/Dtmcli/Dtmcli.csproj b/src/Dtmcli/Dtmcli.csproj index d19eade..2107ff2 100644 --- a/src/Dtmcli/Dtmcli.csproj +++ b/src/Dtmcli/Dtmcli.csproj @@ -1,24 +1,41 @@ - - netstandard2.0;netstandard2.1;net5.0 - https://github.com/dtm-labs/dtmcli-csharp - https://github.com/dtm-labs/dtmcli-csharp - Dtmcli - Dtmcli - a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端 - 0.3.0 - - geffzhang - false - MIT - - - - - - - - + + netstandard2.0;netstandard2.1;net5.0;net6.0 + https://github.com/dtm-labs/dtmcli-csharp + https://github.com/dtm-labs/dtmcli-csharp + Dtmcli + Dtmcli + a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端 + 0.3.0 + + geffzhang + false + MIT + + + + + + + + + + + + + + + + + + + + + + + + +