Skip to content

Commit

Permalink
chore: add code coverage (#518)
Browse files Browse the repository at this point in the history
* chore: add code coverage

* pr-fix: only test net6.0

* pr-fix: add coverlet packages

* pr-fix: add status badge
  • Loading branch information
stijnmoreels committed Jan 20, 2023
1 parent f524607 commit 00fad63
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Code Coverage"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Coverlet coverage test
uses: b3b00/coverlet-action@1.2.4
with:
testProject: 'src/Arcus.Observability.Tests.Unit/Arcus.Observability.Tests.Unit.csproj'
excludes: '[Arcus.Observability.Tests.*]**'
threshold: 80
output: 'coverage.xml'
outputFormat: 'opencover'

- name: Codecov
uses: codecov/codecov-action@v3.1.1
if: always()
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Arcus - Observability
[![Build Status](https://dev.azure.com/codit/Arcus/_apis/build/status/Commit%20builds/CI%20-%20Arcus.Observability?branchName=main)](https://dev.azure.com/codit/Arcus/_build/latest?definitionId=733&branchName=main)
[![NuGet Badge](https://buildstats.info/nuget/Arcus.Observability.Correlation?includePreReleases=true)](https://www.nuget.org/packages/Arcus.Observability.Correlation/)
[![codecov](https://codecov.io/gh/arcus-azure/arcus.observability/branch/main/graph/badge.svg?token=59ITMASWGX)](https://codecov.io/gh/arcus-azure/arcus.observability)

Observability with Microsoft Azure in a breeze.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoWarn>CS0618</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
Expand Down

0 comments on commit 00fad63

Please sign in to comment.