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
80 changes: 36 additions & 44 deletions .github/workflows/wf-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x
8.0.x
dotnet-version: 8.0.x

- name: Restore NuGet Packages
run: dotnet restore
Expand All @@ -36,56 +31,53 @@ jobs:
path: ${{ github.workspace }}

test:
needs: build
needs: build
runs-on: windows-latest
steps:
strategy:
matrix:
dotnet-framework:
- { name: ".NET 3.5", framework: "net35", coverage: false, no-build: true, sdk: "8.0.x" }
- { name: ".NET 4.52", framework: "net452", coverage: false, no-build: true, sdk: "8.0.x" }
- { name: ".NET Core 1.1", framework: "netcoreapp1.1", coverage: false, no-build: false, sdk: "1.0.x" }
- { name: ".NET Core 2.0", framework: "netcoreapp2.0", coverage: true, no-build: false, sdk: "2.0.x" }
- { name: ".NET 5.0", framework: "net5.0", coverage: true, no-build: true, sdk: "5.0.x" }
- { name: ".NET 5.0 Windows", framework: "net5.0-windows", coverage: true, no-build: true, sdk: "5.0.x" }
- { name: ".NET 6.0", framework: "net6.0", coverage: true, no-build: true, sdk: "6.0.x" }
- { name: ".NET 6.0 Windows", framework: "net6.0-windows", coverage: true, no-build: true, sdk: "6.0.x" }
name: Test ${{ matrix.dotnet-framework.name }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Compiled project
path: ${{ github.workspace }}

- name: Install additional .NET SDKs
- name: Install .NET SDK ${{ matrix.dotnet-framework.sdk }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
1.0.x
2.0.x
5.0.x
6.0.x
8.0.x

- name: Run test .NET 3.5
working-directory: QRCoderTests
run: dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming

- name: Run test .NET 4.52
working-directory: QRCoderTests
run: dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming

- name: Run test .NET Core 1.1
working-directory: QRCoderTests
run: dotnet test -c Release -f netcoreapp1.1 --nologo # No coverage for .NETCORE 1.1 because Coverlet doesn't support it https://github.com/coverlet-coverage/coverlet/issues/466

- name: Run test .NET Core 2.0
working-directory: QRCoderTests
run: dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Run test .NET 5.0
working-directory: QRCoderTests
run: dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet-version: ${{ matrix.dotnet-framework.sdk }}

- name: Run test .NET 5.0 Windows
- name: Run tests for ${{ matrix.dotnet-framework.name }}
working-directory: QRCoderTests
run: dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
run: |
$coverage = if ("${{ matrix.dotnet-framework.coverage }}" -eq "true") { "/p:CollectCoverage=true /p:CoverletOutputFormat=opencover" } else { "" }
$noBuild = if ("${{ matrix.dotnet-framework.no-build }}" -eq "true") { "--no-build" } else { "" }
dotnet test -c Release -f ${{ matrix.dotnet-framework.framework }} --nologo $noBuild $coverage

- name: Run test .NET 6.0
working-directory: QRCoderTests
run: dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
additional-tests:
needs: build
runs-on: windows-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Compiled project
path: ${{ github.workspace }}

- name: Run test .NET 6.0 Windows
working-directory: QRCoderTests
run: dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Run trim analysis
working-directory: QRCoderTrimAnalysis
Expand All @@ -96,7 +88,7 @@ jobs:
run: dotnet test -c Release --nologo --no-build

clean:
needs: [build, test]
needs: [build, test, additional-tests]
if: always()
runs-on: windows-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion QRCoderApiTests/QRCoderApiTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down