Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub action unittest logger #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
47 changes: 1 addition & 46 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +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

build-mono:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install xvfb-run
run: sudo apt -y install xvfb

- name: Download nuget.exe
run: wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe

- name: nuget restore
run: mono nuget.exe restore

- name: MSBuild
run: msbuild /target:build

- name: Run tests
run: xvfb-run dotnet vstest KeeTrayTOTP.Tests/bin/Debug/KeeTrayTOTP.Tests.dll
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
2 changes: 1 addition & 1 deletion KeeTrayTOTP/Menu/LegacyTrayMenuItemProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void SetUpLegacyContextMenuEntries()

public override ToolStripMenuItem ProvideMenuItem()
{
return null;
return new ToolStripMenuItem();
}

private void OnTrayContextMenuOpened(object sender, EventArgs e)
Expand Down