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

.NET - adjust coverage sample #22

Merged
merged 8 commits into from
Aug 28, 2024
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,17 @@ jobs:
with:
dotnet-version: '7.0'

- name: Restore dependencies
working-directory: NET/coverlet
run: dotnet restore
- name: Add coverlet dependencies
working-directory: NET/coverlet/UnitTestProject
run: |
dotnet add package coverlet.msbuild; dotnet add package coverlet.collector

- name: Build solution
working-directory: NET/coverlet
run: dotnet build --no-restore

- name: Change directory to test project
working-directory: NET/coverlet
run: |
dotnet add package coverlet.msbuild
run: dotnet build

- name: Run tests with code coverage
run: dotnet test /p:CollectCoverage=true /p:CoverletOutput=./.qodana/code-coverage /p:CoverletOutputFormat=lcov
run: dotnet test /p:CollectCoverage=true /p:CoverletOutput=../.qodana/code-coverage/ /p:CoverletOutputFormat=lcov
working-directory: NET/coverlet

- name: Archive coverage data
Expand Down
2 changes: 1 addition & 1 deletion NET/coverlet/Class2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void UnusedMethod()
public int MyProperty1
{
get => MyProperty;
set => MyProperty = value;
set => MyProperty2 = value;
}

public int MyProperty2
Expand Down
2 changes: 2 additions & 0 deletions NET/coverlet/qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
profile:
name: qodana.single:NetCoverageInspection
Loading