diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b1f28ad..86e59fd 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -55,18 +55,26 @@ jobs: # different TFM (or both) — useful pre-release or when investigating TFM-specific regressions. - name: Test (net8.0) if: github.event_name == 'workflow_dispatch' && (inputs.frameworks == 'net8.0' || inputs.frameworks == 'both') - run: dotnet test --no-build --verbosity normal --framework net8.0 --logger "junit;LogFilePath=test-results/{assembly}.net8.0.xml" + run: dotnet test --no-build --verbosity normal --framework net8.0 --logger "junit;LogFilePath=test-results/{assembly}.net8.0.xml" --collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory ./TestResults env: GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} # Enabled by the manual Run-workflow checkbox OR a run-billable-tests label on the PR. RUN_BILLABLE_TESTS: ${{ inputs.run_billable || contains(github.event.pull_request.labels.*.name, 'run-billable-tests') }} - name: Test (net10.0) if: github.event_name != 'workflow_dispatch' || inputs.frameworks == 'net10.0' || inputs.frameworks == 'both' - run: dotnet test --no-build --verbosity normal --framework net10.0 --logger "junit;LogFilePath=test-results/{assembly}.net10.0.xml" + run: dotnet test --no-build --verbosity normal --framework net10.0 --logger "junit;LogFilePath=test-results/{assembly}.net10.0.xml" --collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory ./TestResults env: GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} # Enabled by the manual Run-workflow checkbox OR a run-billable-tests label on the PR. RUN_BILLABLE_TESTS: ${{ inputs.run_billable || contains(github.event.pull_request.labels.*.name, 'run-billable-tests') }} + - name: Upload coverage to Codecov + if: always() + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./TestResults + fail_ci_if_error: false + verbose: true - name: TestGlance if: always() uses: testglance/action@fc6cacb2cb4926081de56e1983e9be9ba454c87c # v1 diff --git a/README.md b/README.md index c2d979e..f9af360 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![NuGet Version](https://img.shields.io/nuget/v/GoogleMapsApi.svg)](https://www.nuget.org/packages/GoogleMapsApi/) [![Build Status](https://github.com/maximn/google-maps/actions/workflows/dotnet.yml/badge.svg)](https://github.com/maximn/google-maps/actions/workflows/dotnet.yml) [![CodeQL](https://github.com/maximn/google-maps/actions/workflows/codeql.yml/badge.svg)](https://github.com/maximn/google-maps/actions/workflows/codeql.yml) +[![codecov](https://codecov.io/gh/maximn/google-maps/branch/master/graph/badge.svg)](https://codecov.io/gh/maximn/google-maps) [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/maximn/google-maps?label=openssf%20scorecard)](https://scorecard.dev/viewer/?uri=github.com/maximn/google-maps) [![License: BSD-2-Clause](https://img.shields.io/badge/License-BSD_2--Clause-blue.svg)](LICENSE.md) [![.NET](https://img.shields.io/badge/.NET-net10.0%20%7C%20net8.0%20%7C%20netstandard2.0-512BD4)](https://dotnet.microsoft.com/) diff --git a/coverlet.runsettings b/coverlet.runsettings new file mode 100644 index 0000000..21fa5bf --- /dev/null +++ b/coverlet.runsettings @@ -0,0 +1,15 @@ + + + + + + + cobertura + + [GoogleMapsApi]*,[GoogleMapsApi.Extensions.DependencyInjection]* + Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute + + + + +