From ab3f45e7e1a32fadde6dbaa107f9949a14a8a299 Mon Sep 17 00:00:00 2001 From: Charlie Stanley Date: Mon, 19 Oct 2020 15:03:52 -0700 Subject: [PATCH] Added codecov integration (#436) --- .codecov.yml | 10 ++++++++++ .github/workflows/sdk_build.yml | 9 +++++++-- README.md | 1 + test/Dapr.Actors.Test/Dapr.Actors.Test.csproj | 4 ++++ .../Dapr.AspNetCore.IntegrationTest.csproj | 4 ++++ test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj | 4 ++++ test/Dapr.Client.Test/Dapr.Client.Test.csproj | 4 ++++ 7 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..2a94c14e --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,10 @@ +coverage: + status: + project: + default: + # basic + target: auto + threshold: 0% + +ignore: + - test # - tests diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 2a9c411c..a54da66d 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -27,10 +27,13 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 3.1.301 + - name: Test solution - release + run: | + unset GITHUB_ACTIONS #disable deterministic builds, just for test run. Deterministic builds break coverage for some reason + dotnet test test/test.sln --configuration release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover + dotnet clean # remove the artifacts so they can be rebuild with deterministic builds enabled - name: Build solution - release run: dotnet build all.sln --configuration release - - name: Test solution - release - run: dotnet test test/test.sln --configuration release - name: Generate Nuget Packages - release run: dotnet pack src/prod.sln --configuration release - name: upload artifacts @@ -38,6 +41,8 @@ jobs: with: name: release_drop path: ${{ env.NUPKG_OUTDIR }} + - name: Upload test coverage + uses: codecov/codecov-action@v1 - name: Publish binaries to github for tags if: startswith(github.ref, 'refs/tags/v') run: | diff --git a/README.md b/README.md index 158c9990..34e9c9c6 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Dapr is a portable, event-driven, serverless runtime for building distributed ap [![Build Status](https://github.com/dapr/dotnet-sdk/workflows/build/badge.svg)](https://github.com/dapr/dotnet-sdk/actions?workflow=build) [![Gitter](https://badges.gitter.im/Dapr/community.svg)](https://gitter.im/Dapr/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![codecov](https://codecov.io/gh/dapr/dotnet-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/dapr/dotnet-sdk) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) - [dapr.io](https://dapr.io) diff --git a/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj b/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj index c30a4102..25af9bf8 100644 --- a/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj +++ b/test/Dapr.Actors.Test/Dapr.Actors.Test.csproj @@ -4,6 +4,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj b/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj index 7cbcca55..7826a4c3 100644 --- a/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj +++ b/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj @@ -4,6 +4,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj b/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj index cedad980..c3d27cd3 100644 --- a/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj +++ b/test/Dapr.AspNetCore.Test/Dapr.AspNetCore.Test.csproj @@ -4,6 +4,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/test/Dapr.Client.Test/Dapr.Client.Test.csproj b/test/Dapr.Client.Test/Dapr.Client.Test.csproj index 19fa4b6a..a0df52e5 100644 --- a/test/Dapr.Client.Test/Dapr.Client.Test.csproj +++ b/test/Dapr.Client.Test/Dapr.Client.Test.csproj @@ -4,6 +4,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all +