diff --git a/.github/workflows/wf-build-test.yml b/.github/workflows/wf-build-test.yml index 64cc56d3..383b23f3 100644 --- a/.github/workflows/wf-build-test.yml +++ b/.github/workflows/wf-build-test.yml @@ -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 @@ -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 @@ -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: diff --git a/QRCoderApiTests/QRCoderApiTests.csproj b/QRCoderApiTests/QRCoderApiTests.csproj index 23daa646..f6dabcb8 100644 --- a/QRCoderApiTests/QRCoderApiTests.csproj +++ b/QRCoderApiTests/QRCoderApiTests.csproj @@ -1,7 +1,7 @@ - net6.0-windows + net8.0-windows enable true