Added codecov integration (#436)

This commit is contained in:
Charlie Stanley 2020-10-19 15:03:52 -07:00
parent 731234e38d
commit ab3f45e7e1
7 changed files with 34 additions and 2 deletions

10
.codecov.yml Normal file
View File

@ -0,0 +1,10 @@
coverage:
status:
project:
default:
# basic
target: auto
threshold: 0%
ignore:
- test # - tests

View File

@ -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: |

View File

@ -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)

View File

@ -4,6 +4,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Moq" Version="4.13.1" />

View File

@ -4,6 +4,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.0.0" />

View File

@ -4,6 +4,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />

View File

@ -4,6 +4,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
<PackageReference Include="Grpc.Core.Testing" Version="2.32.0" />