Skip to content

Commit

Permalink
Merge pull request #15 from open-feature/chore/add-code-coverage
Browse files Browse the repository at this point in the history
Add code coverage build
  • Loading branch information
beeme1mr authored Jul 8, 2022
2 parents e017638 + 13caf06 commit 9c48091
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Code Coverage

on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'

jobs:
build-test-report:
runs-on: ubuntu-latest

strategy:
matrix:
version: [net6.0]

env:
OS: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true

- name: Test ${{ matrix.version }}
run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- uses: codecov/codecov-action@v3.1.0
with:
env_vars: OS
name: Code Coverage for ${{ matrix.os }}
fail_ci_if_error: true
verbose: true
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# OpenFeature SDK for .NET
# OpenFeature SDK for .NET

[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)]()
[![codecov](https://codecov.io/gh/open-feature/dotnet-sdk/branch/main/graph/badge.svg?token=MONAVJBXUJ)](https://codecov.io/gh/open-feature/dotnet-sdk)

OpenFeature is an open standard for feature flag management, created to support a robust feature flag ecosystem using cloud native technologies. OpenFeature will provide a unified API and SDK, and a developer-first, cloud-native implementation, with extensibility for open source and commercial offerings.

Expand All @@ -17,7 +18,7 @@ The packages will aim to support all current .NET versions. Refer to the current

## Basic Usage

```csharp
```csharp
OpenFeature.SetProvider(new NoOpProvider());
var client = OpenFeature.GetClient();

Expand Down
1 change: 1 addition & 0 deletions build/Common.tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Refer to https://docs.microsoft.com/nuget/concepts/package-versioning for semver syntax.
-->
<AutoFixtureVer>[4.17.0]</AutoFixtureVer>
<CoverletCollectorVer>[3.1.2]</CoverletCollectorVer>
<FluentAssertionsVer>[6.7.0]</FluentAssertionsVer>
<MicrosoftNETTestSdkPkgVer>[17.2.0]</MicrosoftNETTestSdkPkgVer>
<MoqVer>[4.18.1]</MoqVer>
Expand Down
8 changes: 8 additions & 0 deletions test/OpenFeature.Tests/OpenFeature.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

<ItemGroup>
<PackageReference Include="AutoFixture" Version="$(AutoFixtureVer)" />
<PackageReference Include="coverlet.collector" Version="$(CoverletCollectorVer)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="$(CoverletCollectorVer)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVer)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
<PackageReference Include="Moq" Version="$(MoqVer)" />
Expand Down

0 comments on commit 9c48091

Please sign in to comment.