Skip to content
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
20 changes: 15 additions & 5 deletions .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,21 @@ jobs:
with:
dotnet-version: '9.0.x'

- name: Restore
run: dotnet restore

- name: Build, Test
run: dotnet test --no-restore --framework ${{ matrix.dotnet-tfm }} --configuration ${{ env.buildConfiguration }} --verbosity quiet --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-${{ matrix.dotnet-tfm }}"
- name: Setup .NET Framework 4.8 Developer Pack (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
# Install .NET Framework 4.8 Developer Pack for building net48 projects
$installerUrl = "https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0fd66638cde16859462a6243a4629a50/ndp48-devpack-enu.exe"
$installerPath = "$env:TEMP\ndp48-devpack-enu.exe"
Write-Host "Downloading .NET Framework 4.8 Developer Pack..."
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath
Write-Host "Installing .NET Framework 4.8 Developer Pack..."
Start-Process -FilePath $installerPath -ArgumentList "/quiet", "/norestart" -Wait
Write-Host ".NET Framework 4.8 Developer Pack installed."

- name: Restore, Build, Test
run: dotnet test --framework ${{ matrix.dotnet-tfm }} --configuration ${{ env.buildConfiguration }} --verbosity quiet --logger trx --collect:"XPlat Code Coverage" --results-directory "TestResults-${{ matrix.dotnet-tfm }}"
env:
# Enable containers for integration tests only on Linux
FM_TestConnectionStrings__MySql__ContainerEnabled: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<Choose>
<When Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<!-- Condition="!$([MSBuild]::IsOSPlatform('Linux'))"; Assume Windows OS; we still test .NET Framework 4.8 for backwards compatibility reasons -->
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

Expand All @@ -19,6 +29,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="$(MsCodeAnalysisAnalyzerTestingVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading