mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-18 04:38:09 +00:00
Collect .NET coverage info (#2023)
## Summary of the Pull Request Collect .NET coverage during build and display it in GitHub Summary. ## Info on Pull Request Add the `reportgenerator` tool, run it after tests. ## Validation Steps Performed Run workflow and make sure it works. See example coverage output here: https://github.com/microsoft/onefuzz/actions/runs/2458088617
This commit is contained in:
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@ -267,6 +267,7 @@ jobs:
|
||||
run: |
|
||||
cd src/ApiService/
|
||||
dotnet restore --locked-mode
|
||||
dotnet tool restore
|
||||
- name: Check Formatting
|
||||
run: |
|
||||
cd src/ApiService/
|
||||
@ -275,10 +276,12 @@ jobs:
|
||||
run: |
|
||||
cd src/ApiService/
|
||||
dotnet build -warnaserror --configuration Release
|
||||
- name: Test
|
||||
- name: Test & Collect coverage info
|
||||
run: |
|
||||
cd src/ApiService/
|
||||
dotnet test --no-restore
|
||||
dotnet test --no-restore --collect:"XPlat Code Coverage"
|
||||
dotnet tool run reportgenerator -reports:Tests/TestResults/*/coverage.cobertura.xml -targetdir:coverage -reporttypes:MarkdownSummary
|
||||
cat coverage/*.md > $GITHUB_STEP_SUMMARY
|
||||
- name: copy artifacts
|
||||
run: |
|
||||
./src/ci/get-version.sh > src/deployment/VERSION
|
||||
|
12
src/ApiService/.config/dotnet-tools.json
Normal file
12
src/ApiService/.config/dotnet-tools.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-reportgenerator-globaltool": {
|
||||
"version": "5.1.9",
|
||||
"commands": [
|
||||
"reportgenerator"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user