Skip to content

Commit f1fc4b5

Browse files
authored
collect code coverage (#101)
* cover * retry * retry * pkg * retry * separate
1 parent cd4f511 commit f1fc4b5

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

.github/workflows/dotnet-core.yml renamed to .github/workflows/pr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Build and Test
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
75
branches: [ main ]
86

@@ -23,7 +21,7 @@ jobs:
2321
run: dotnet build --configuration Release --no-restore
2422
- name: Test
2523
run: dotnet test --no-restore --verbosity normal
26-
- name: Publish NuGet package
24+
- name: Publish NuGet artifacts
2725
uses: actions/upload-artifact@v1
2826
with:
2927
name: NuGet package

.github/workflows/push.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build, Test and Package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: windows-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup .NET Core
15+
uses: actions/setup-dotnet@v1
16+
with:
17+
dotnet-version: 6.0.x
18+
- name: Install dependencies
19+
run: dotnet restore
20+
- name: Build
21+
run: dotnet build --configuration Release --no-restore
22+
- name: Test
23+
run: dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
24+
- name: Publish NuGet artifacts
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: NuGet package
28+
path: BitFaster.Caching/bin/Release/
29+
- name: Publish coverage report to coveralls.io
30+
uses: coverallsapp/github-action@master
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.info

BitFaster.Caching.UnitTests/BitFaster.Caching.UnitTests.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11+
</PackageReference>
812
<PackageReference Include="FluentAssertions" Version="5.10.3" />
913
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
1014
<PackageReference Include="xunit" Version="2.4.0" />
1115
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
12-
<PackageReference Include="coverlet.collector" Version="1.2.0" />
1316
</ItemGroup>
1417

1518
<ItemGroup>

0 commit comments

Comments
 (0)