Skip to content

Commit

Permalink
Add unit test logger for github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
dannoe committed May 12, 2020
1 parent 5e7b904 commit 00201f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions KeeTrayTOTP.Tests/KeeTrayTOTP.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="1.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
</ItemGroup>
Expand Down

0 comments on commit 00201f5

Please sign in to comment.