-
Notifications
You must be signed in to change notification settings - Fork 34
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
chore: add macos, linux in ci #513
base: master
Are you sure you want to change the base?
Conversation
Looks like the Microsoft.CodeAnalysis assembly tries to load SQLite and fails. But there is way to much output from normal succeeding tests. |
@@ -1,7 +1,7 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<RootNamespace>NUnit.Analyzers.Tests</RootNamespace> | |||
<TargetFrameworks>net6.0;net462</TargetFrameworks> | |||
<TargetFramework>net6.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be done conditionally on OS. We still want to test .net framework on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with your suggestion.
Therefore, I changed only ci.yml like this.
552b72c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can test .NET and .NET Framework on windows, and .NET test on unix.
I'm currently traveling and only have access to my phone. |
dotnet tool install --global dotnet-coverage | ||
dotnet test --collect:"XPlat Code Coverage" -f net6.0 ./src/nunit.analyzers.tests/ | ||
dotnet-coverage merge -o merged.cobertura.xml -f cobertura -r coverage.cobertura.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for the coverlet nuget package. Dotnet can output cobertura natively..
You can call it like: dotnet test --collect:"Code Coverage;Format=Cobertura"
<PackageReference Include="coverlet.collector" Version="3.2.0"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary anymore.
coverage: | ||
paths: | ||
- merged.covertura.xml | ||
|
||
codeToTestRatio: | ||
code: # files to count as "Code" | ||
- 'src/nunit.analyzers/**/*.cs' | ||
test: # files to count as "Test" | ||
- 'src/nunit.analyzers.tests/**/*.cs' | ||
|
||
comment: | ||
if: is_pull_request | ||
|
||
report: | ||
if: is_default_branch | ||
datastores: | ||
- artifact://${GITHUB_REPOSITORY} | ||
|
||
diff: | ||
datastores: | ||
- artifact://${GITHUB_REPOSITORY} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs align with the nunit changes to use coverlet.
- name: Post Coverage | ||
uses: k1LoW/octocov-action@v0 | ||
if: runner.os == 'Linux' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs align with the nunit/nunit#4286 to use coverlet.
On Windows, NET Framework and .NET6 is tested on CI.
.NET6 testing is now done in CI on Linux and Mac.