From 12fe9345f556ebe45f3fec1b15c73b79e8389dfa Mon Sep 17 00:00:00 2001 From: Alexey Zimarev Date: Sat, 15 Nov 2025 17:25:43 +0100 Subject: [PATCH] Use .NET 10 GA --- .github/workflows/build-dev.yml | 6 +-- .github/workflows/pull-request.yml | 41 +++++-------------- test/Directory.Build.props | 4 +- .../DownloadFileTests.cs | 5 +++ 4 files changed, 21 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index a3d704238..6634c08ec 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -26,12 +26,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Unshallow run: git fetch --prune --unshallow diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9eeea5b38..c2d1d079d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -19,35 +19,26 @@ jobs: with: name: Event File path: ${{ github.event_path }} + test-windows: runs-on: windows-latest strategy: matrix: - dotnet: ['net48', 'net8.0', 'net9.0'] + dotnet: [ 'net48', 'net8.0', 'net9.0', 'net10.0' ] steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v5 - - - name: Setup .NET + - name: Setup .NET uses: actions/setup-dotnet@v5 with: dotnet-version: | 8.0.x 9.0.x - - - name: Setup .NET 10 - uses: actions/setup-dotnet@v5 - with: - dotnet-version: | 10.0.x - dotnet-quality: 'preview' - - - name: Run tests + - name: Run tests run: dotnet test -c Debug -f ${{ matrix.dotnet }} - - - name: Upload Test Results + - name: Upload Test Results if: always() uses: actions/upload-artifact@v5 with: @@ -61,31 +52,21 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet: ['net8.0', 'net9.0'] + dotnet: [ 'net8.0', 'net9.0', 'net10.0' ] steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v5 - - - name: Setup .NET + - name: Setup .NET uses: actions/setup-dotnet@v5 with: dotnet-version: | 8.0.x 9.0.x - - - name: Setup .NET 10 - uses: actions/setup-dotnet@v5 - with: - dotnet-version: | 10.0.x - dotnet-quality: 'preview' - - - name: Run tests + - name: Run tests run: dotnet test -f ${{ matrix.dotnet }} - - - name: Upload Test Results + - name: Upload Test Results if: always() uses: actions/upload-artifact@v5 with: diff --git a/test/Directory.Build.props b/test/Directory.Build.props index b3c32f6d1..a590b3b0f 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,9 +3,9 @@ true false - net48;net8.0;net9.0 + net48;net8.0;net9.0;net10.0 disable - xUnit1033 + xUnit1033;CS8002 trx%3bLogFileName=$(MSBuildProjectName).trx $(RepoRoot)/test-results/$(TargetFramework) diff --git a/test/RestSharp.Tests.Integrated/DownloadFileTests.cs b/test/RestSharp.Tests.Integrated/DownloadFileTests.cs index d85428ecc..94b6ced16 100644 --- a/test/RestSharp.Tests.Integrated/DownloadFileTests.cs +++ b/test/RestSharp.Tests.Integrated/DownloadFileTests.cs @@ -1,4 +1,5 @@ using System.Text; + // ReSharper disable MethodHasAsyncOverload namespace RestSharp.Tests.Integrated; @@ -32,7 +33,11 @@ public async Task AdvancedResponseWriter_without_ResponseWriter_reads_stream() { AdvancedResponseWriter = (response, request) => { var buf = new byte[16]; // ReSharper disable once MustUseReturnValue +#if NET + response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().ReadExactly(buf); +#else response.Content.ReadAsStreamAsync().GetAwaiter().GetResult().Read(buf, 0, buf.Length); +#endif tag = Encoding.ASCII.GetString(buf, 6, 4); return new RestResponse(request); }