Skip to content

Commit

Permalink
Run CI tests against .NET 4.6.2 as well
Browse files Browse the repository at this point in the history
This is the only version of .NET Framework supported by the MSTest dependencies
for our test project.
  • Loading branch information
mqudsi committed Apr 28, 2024
1 parent 824c9d2 commit ed91928
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 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: '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"
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

0 comments on commit ed91928

Please sign in to comment.