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: |
|
run: |
|
||||||
cd src/ApiService/
|
cd src/ApiService/
|
||||||
dotnet restore --locked-mode
|
dotnet restore --locked-mode
|
||||||
|
dotnet tool restore
|
||||||
- name: Check Formatting
|
- name: Check Formatting
|
||||||
run: |
|
run: |
|
||||||
cd src/ApiService/
|
cd src/ApiService/
|
||||||
@ -275,10 +276,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd src/ApiService/
|
cd src/ApiService/
|
||||||
dotnet build -warnaserror --configuration Release
|
dotnet build -warnaserror --configuration Release
|
||||||
- name: Test
|
- name: Test & Collect coverage info
|
||||||
run: |
|
run: |
|
||||||
cd src/ApiService/
|
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
|
- name: copy artifacts
|
||||||
run: |
|
run: |
|
||||||
./src/ci/get-version.sh > src/deployment/VERSION
|
./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