Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI tests against .NET 4.6.2 as well #9

Merged
merged 4 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 'ubuntu', version: '8', tfm: 'net8.0' },
{ os: 'windows', version: '4', tfm: 'net462' },
{ os: 'ubuntu', version: '3.1', tfm: 'netcoreapp3.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"
4 changes: 2 additions & 2 deletions Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<ImplicitUsings>disabled</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions Benchmark/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using NeoSmart.Utils;
using System.IO;
using System.Text;

namespace Benchmark
Expand Down
5 changes: 3 additions & 2 deletions UrlBase64/UrlBase64.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.0;net20;net40;netstandard2.0</TargetFrameworks>
Expand Down Expand Up @@ -57,7 +57,8 @@
</None>
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'netstandard1.0' And '$(TargetFramework)' != 'net20' And '$(TargetFramework)' != 'net40'">
<!-- Under CI, TargetFramework is forced to net462 -->
<PropertyGroup Condition="'$(TargetFramework)' != 'netstandard1.0' And '$(TargetFramework)' != 'net20' And '$(TargetFramework)' != 'net40' And '$(TargetFramework)' != 'net462'">
<DefineConstants>$(DefineConstants);WITH_SPAN</DefineConstants>
</PropertyGroup>

Expand Down