From a607142cee8db95ffeb08920b75c438b5b786d45 Mon Sep 17 00:00:00 2001 From: Charley Wu Date: Sat, 28 Sep 2024 13:44:57 +0800 Subject: [PATCH] Improve code coverage report --- .github/workflows/build.yml | 3 ++- .gitignore | 5 ++++- .netconfig | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .netconfig diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f25ed80..7ed811ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,8 @@ jobs: run: | dotnet test --collect:"XPlat Code Coverage" dotnet tool restore - dotnet tool run reportgenerator "-reports:**/coverage.cobertura.xml" "-targetdir:coverlet/reports" "-reporttypes:Cobertura" + dotnet tool run reportgenerator + [[ -f "./coverage/Summary.txt" ]] && cat "./coverage/Summary.txt" - uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index f0768385..d9cefe02 100644 --- a/.gitignore +++ b/.gitignore @@ -385,4 +385,7 @@ yarn-debug.log* yarn-error.log* # pnpm -.pnpm-store/ \ No newline at end of file +.pnpm-store/ + +# coverage reports +/coverage/ \ No newline at end of file diff --git a/.netconfig b/.netconfig new file mode 100644 index 00000000..4db7267b --- /dev/null +++ b/.netconfig @@ -0,0 +1,5 @@ +; https://github.com/danielpalme/ReportGenerator +[ReportGenerator] + reports = "**/coverage.cobertura.xml" + targetdir = "coverage" + reporttypes = "Cobertura;TextSummary" \ No newline at end of file