From ed919286bb1b051abba391ac3d971f4f39e291da Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 28 Apr 2024 11:30:27 -0500 Subject: [PATCH 1/4] Run CI tests against .NET 4.6.2 as well This is the only version of .NET Framework supported by the MSTest dependencies for our test project. --- .github/workflows/dotnet.yml | 10 +++++----- UrlBase64/UrlBase64.csproj | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2032a49..b59ef0c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,27 +15,27 @@ jobs: matrix: dotnet: [ { os: 'windows', version: '2', tfm: 'net20' }, - { os: 'windows', version: '4', tfm: 'net40' }, - { os: 'ubuntu', version: '6', tfm: 'net6.0' }, + { os: 'windows', version: '4', tfm: 'net462' }, + { os: 'ubuntu', version: '3', tfm: 'net3.1' }, { os: 'ubuntu', version: '8', tfm: 'net8.0' }, ] steps: - uses: actions/checkout@v4 - name: Setup .NET - if: endsWith(matrix.dotnet.tfm, '.0') # only for .NET core + if: contains(matrix.dotnet.tfm, '.') # only for .NET core uses: actions/setup-dotnet@v4 id: stepid with: dotnet-version: ${{ matrix.dotnet.version }} # Without global.json, tests will be executed under the latest installed version! - name: Create temporary global.json - if: endsWith(matrix.dotnet.tfm, '.0') # only for .NET core + if: contains(matrix.dotnet.tfm, '.') # only for .NET core run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json - name: Restore packages run: dotnet restore UrlBase64/UrlBase64.csproj -p:Configuration=Release -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" --verbosity normal - name: Build solution run: dotnet build UrlBase64/UrlBase64.csproj -p:Configuration=Release -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" --verbosity normal - name: Run tests - if: endsWith(matrix.dotnet.tfm, '.0') # only for .NET core + if: ${{ ! matrix.dotnet.tfm == 'net20' }} run: dotnet test -p:Configuration=Release --verbosity normal -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" diff --git a/UrlBase64/UrlBase64.csproj b/UrlBase64/UrlBase64.csproj index 56083ce..cf72b9d 100644 --- a/UrlBase64/UrlBase64.csproj +++ b/UrlBase64/UrlBase64.csproj @@ -1,4 +1,4 @@ - + netstandard1.0;net20;net40;netstandard2.0 @@ -57,7 +57,8 @@ - + + $(DefineConstants);WITH_SPAN From 763d19e43c6de4d1470874345146d8e0540ef8aa Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 28 Apr 2024 11:33:41 -0500 Subject: [PATCH 2/4] Correct tfm moniker for .NET Core 3.1 --- .github/workflows/dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b59ef0c..8c4eb7d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,8 +16,8 @@ jobs: dotnet: [ { os: 'windows', version: '2', tfm: 'net20' }, { os: 'windows', version: '4', tfm: 'net462' }, - { os: 'ubuntu', version: '3', tfm: 'net3.1' }, - { os: 'ubuntu', version: '8', tfm: 'net8.0' }, + { os: 'ubuntu', version: '3.1', tfm: 'netcoreapp3.1' }, + { os: 'ubuntu', version: '8', tfm: 'net8.0' }, ] steps: From 011f30b0e1d033b951c75e8337fa610c87a3724d Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 28 Apr 2024 11:35:03 -0500 Subject: [PATCH 3/4] Correct yaml if condition --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8c4eb7d..3ce6f7d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -37,5 +37,5 @@ jobs: - name: Build solution run: dotnet build UrlBase64/UrlBase64.csproj -p:Configuration=Release -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" --verbosity normal - name: Run tests - if: ${{ ! matrix.dotnet.tfm == 'net20' }} + if: matrix.dotnet.tfm != 'net20' run: dotnet test -p:Configuration=Release --verbosity normal -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" From 34906b5d716930ab0e91fa9de72f983e0ad6bdec Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 28 Apr 2024 11:37:38 -0500 Subject: [PATCH 4/4] Disable implicit usings (unsupported under netcoreapp3.1) --- Benchmark/Benchmark.csproj | 4 ++-- Benchmark/Program.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Benchmark/Benchmark.csproj b/Benchmark/Benchmark.csproj index 9867a4d..1d95b40 100644 --- a/Benchmark/Benchmark.csproj +++ b/Benchmark/Benchmark.csproj @@ -1,9 +1,9 @@ - + Exe net8.0 - enable + disabled enable diff --git a/Benchmark/Program.cs b/Benchmark/Program.cs index c72dd42..a90682c 100644 --- a/Benchmark/Program.cs +++ b/Benchmark/Program.cs @@ -1,6 +1,7 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using NeoSmart.Utils; +using System.IO; using System.Text; namespace Benchmark