-
Notifications
You must be signed in to change notification settings - Fork 33
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?
Changes from all commits
4a1c625
8706511
552b72c
283e5b2
7b8b0e3
aafb641
4a4e692
3d6e3f4
41ae50e
8b58436
c7f1005
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,28 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@main | ||
with: | ||
global-json-file: ./global.json | ||
- name: dotnet test | ||
run: dotnet test ./src/nunit.analyzers.tests/ | ||
|
||
- name: .NET6.0 Test | ||
run: | | ||
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 | ||
|
||
- name: .NET Framework Test | ||
if: runner.os == 'Windows' | ||
run: | | ||
dotnet test -f net462 ./src/nunit.analyzers.tests/ | ||
|
||
- name: Post Coverage | ||
uses: k1LoW/octocov-action@v0 | ||
if: runner.os == 'Linux' | ||
Comment on lines
+33
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs align with the nunit/nunit#4286 to use coverlet. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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} | ||
Comment on lines
+1
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs align with the nunit changes to use coverlet. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="coverlet.collector" Version="3.2.0"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
Comment on lines
+8
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary anymore. |
||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" /> | ||
</ItemGroup> | ||
|
||
|
@@ -17,8 +21,7 @@ | |
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\nunit.analyzers\nunit.analyzers.csproj" | ||
OutputItemType="Analyzer" /> | ||
<ProjectReference Include="..\nunit.analyzers\nunit.analyzers.csproj" OutputItemType="Analyzer" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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"