Skip to content

Commit

Permalink
Fix multi-target tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbl committed Dec 6, 2024
1 parent eedcdc7 commit 933fe66
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ jobs:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
dotnet-version: ['3.1.x', '5.0.x', '6.0.x', '7.0.x']

dotnet-version: ['3.1', '5.0', '6.0', '7.0', '8.0']
exclude:
- os: macos-latest
dotnet-version: 3.1
- os: macos-latest
dotnet-version: 5.0
fail-fast: false
runs-on: ${{ matrix.os }}
name: Build and run tests
Expand All @@ -24,17 +28,21 @@ jobs:
with:
fetch-depth: 0
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore NuGet packages
run: dotnet restore --verbosity normal
- name: Build solution
run: dotnet build --configuration Release --no-restore --verbosity normal
- name: Restore test project
run: dotnet restore --verbosity normal -p:TargetFramework=net${{ matrix.dotnet-version }} QrCodeGeneratorTest
- name: Restore library
run: dotnet restore --verbosity normal -p:TargetFramework=netstandard2.0 QrCodeGenerator
- name: Build library
run: dotnet build --configuration Release --no-restore --verbosity normal -p:TargetFramework=netstandard2.0 QrCodeGenerator
- name: Build test project
run: dotnet build --configuration Release --no-restore --verbosity normal -p:TargetFramework=net${{ matrix.dotnet-version }} QrCodeGeneratorTest
- name: Run tests
run: dotnet test --no-build --verbosity normal --logger:"html;LogFileName=../../TestResults-${{ matrix.os }}-dotnet_${{ matrix.dotnet-version }}.html"
run: dotnet test --no-build --verbosity normal --logger:"html;LogFileName=../../TestResults-${{ matrix.os }}-dotnet_${{ matrix.dotnet-version }}.html" -P:TargetFramework=netnet${{ matrix.dotnet-version }} QrCodeGeneratorTest
- name: Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: TestResults-${{ matrix.os }}-dotnet_${{ matrix.dotnet-version }}.html
Expand Down
2 changes: 1 addition & 1 deletion QrCodeGeneratorTest/QrCodeGeneratorTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>

Expand Down

0 comments on commit 933fe66

Please sign in to comment.