From 1447ebd0d2804a4dcd1204bb8cde1ba7faa87a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=9A=D0=B2?= =?UTF-8?q?=D0=B0=D1=88=D0=B8=D0=BD?= Date: Thu, 26 Dec 2024 19:31:35 +0400 Subject: [PATCH] #43. Added code coverage in ci/cd github action --- .github/workflows/cicd.yaml | 13 +++++++++++-- README.md | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index a989513..4d40e45 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -33,8 +33,17 @@ jobs: run: dotnet format --verify-no-changes --exclude *\xunit*\* - name: Build run: dotnet build --configuration Release --verbosity minimal - - name: Test (Unit) - run: dotnet test Tests/LyricsScraperNET.UnitTest + - name: Test (Unit) with Coverage + run: | + dotnet test --configuration Release --collect:"XPlat Code Coverage" --results-directory ./TestResults + env: + COVERLET_OUTPUT_FORMAT: cobertura + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./TestResults/**/coverage.cobertura.xml + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true # Temporarily switched off. There are errors during CI. # - name: Test (Integration) # run: dotnet test Tests/LyricsScraperNET.IntegrationTest diff --git a/README.md b/README.md index d4764ad..4ad1088 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![CI/CD LyricsScraperNET](https://github.com/skuill/LyricsScraperNET/actions/workflows/cicd.yaml/badge.svg)](https://github.com/skuill/LyricsScraperNET/actions/workflows/cicd.yaml) [![NuGet](https://img.shields.io/nuget/vpre/LyricsScraperNET?label=NuGet)](https://www.nuget.org/packages/LyricsScraperNET/) [![NuGet Downloads](https://img.shields.io/nuget/dt/LyricsScraperNET?label=Downloads)](https://www.nuget.org/packages/LyricsScraperNET/) +[![codecov](https://codecov.io/github/skuill/LyricsScraperNET/graph/badge.svg?token=4WVKKT969S)](https://codecov.io/github/skuill/LyricsScraperNET) [![License](https://img.shields.io/github/license/skuill/LyricsScraperNET)](./LICENSE) **LyricsScraperNET** is a versatile .NET library that provides an API for searching song lyrics from various external providers.