From 00201f5648d80876d092f1c7cc05c00066419cb0 Mon Sep 17 00:00:00 2001 From: dannoe Date: Sun, 26 Apr 2020 22:55:57 +0200 Subject: [PATCH] Add unit test logger for github actions. --- .github/workflows/pr.yml | 26 +--------------------- KeeTrayTOTP.Tests/KeeTrayTOTP.Tests.csproj | 1 + 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 44116c4..2170b16 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,32 +22,8 @@ jobs: - name: nuget restore run: nuget restore KeeTrayTOTP.sln - - name: Install dotnet-sonarscanner - run: dotnet tool install --global dotnet-sonarscanner - - - name: SonarScanner Begin - run: dotnet sonarscanner begin /k:KeeTrayTOTP_KeeTrayTOTP /o:keetraytotp /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="coverage.opencover.xml" - - name: MSBuild run: msbuild KeeTrayTOTP.sln /m - name: Run tests - # It looks like the dotnet CLI can no longer build net45 projects? see https://github.com/microsoft/msbuild/issues/4704 - run: dotnet test --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings - - - name: Copy coverage file to root for SonarQube. SonarQube currently does not support wildcards, and the coverage file ends up in a new folder with a random name. - run: cp -Path ("KeeTrayTOTP.Tests\TestResults\" + (gci -Path KeeTrayTOTP.Tests\TestResults -Recurse -Force -Name coverage.opencover.xml)) -Destination coverage.opencover.xml - - - name: SonarScanner End - run: dotnet sonarscanner end - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - - name: MSBuild (With Plgx) - run: msbuild KeeTrayTOTP.sln /p:Configuration=ReleasePlgx - - - name: Upload plgx - uses: actions/upload-artifact@v1 - with: - name: KeeTrayTOTP.plgx - path: KeeTrayTOTP\bin\ReleasePlgx\KeeTrayTOTP.plgx + run: dotnet test --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings --logger GitHubActions \ No newline at end of file diff --git a/KeeTrayTOTP.Tests/KeeTrayTOTP.Tests.csproj b/KeeTrayTOTP.Tests/KeeTrayTOTP.Tests.csproj index 4dee41b..ad933b1 100644 --- a/KeeTrayTOTP.Tests/KeeTrayTOTP.Tests.csproj +++ b/KeeTrayTOTP.Tests/KeeTrayTOTP.Tests.csproj @@ -20,6 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive +