Skip to content

Commit ddb392b

Browse files
author
Roman Titov
authored
Merge pull request #95 from romantitov/actions
Update dotnetcore.yml
2 parents 6640458 + 16cb9dc commit ddb392b

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,30 @@ jobs:
1616

1717
- name: Build with dotnet
1818
run: dotnet build src/MockQueryable/*.sln --configuration Release
19-
- name: Test with dotnet
20-
run: dotnet test src/MockQueryable/*.sln
19+
- name: Test with coverage (coverlet)
20+
run: |
21+
mkdir -p TestResults
22+
23+
COVERAGE_DIR="$(pwd)/TestResults"
24+
25+
dotnet test src/MockQueryable/*.sln \
26+
--configuration Release \
27+
--no-build \
28+
/p:CollectCoverage=true \
29+
/p:CoverletOutput="$COVERAGE_DIR/coverage-" \
30+
/p:CoverletOutputFormat=opencover
31+
32+
ls -R "$COVERAGE_DIR" || echo Empty folder
33+
- name: Upload coverage results (artifact)
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: code-coverage
37+
path: TestResults
38+
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v4
41+
with:
42+
files: TestResults/**/*.opencover.xml
43+
flags: unittests
44+
fail_ci_if_error: true
45+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Extensions for mocking [Entity Framework Core](https://github.com/dotnet/efcore)
2222

2323
## ✅ Build & Status
2424

25+
[![codecov](https://codecov.io/github/romantitov/MockQueryable/graph/badge.svg?token=dtiYMUNHUo)](https://codecov.io/github/romantitov/MockQueryable)
2526
![.NET Core](https://github.com/romantitov/MockQueryable/workflows/.NET%20Core/badge.svg)
2627
[![License](https://img.shields.io/github/license/romantitov/MockQueryable.svg)](https://github.com/romantitov/MockQueryable/blob/master/LICENSE)
2728

@@ -138,3 +139,4 @@ See the [sample project](https://github.com/romantitov/MockQueryable/tree/master
138139

139140

140141

142+

src/MockQueryable/MockQueryable.Sample/MockQueryable.Sample.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ItemGroup>
1212
<PackageReference Include="AutoMapper" Version="15.1.0" />
1313
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
14+
<PackageReference Include="coverlet.msbuild" Version="6.0.4" PrivateAssets="All" />
1415
<!--<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />-->
1516
<PackageReference Include="NUnit" Version="4.4.0" />
1617
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0">

0 commit comments

Comments
 (0)