File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed
src/MockQueryable/MockQueryable.Sample Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff 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+
Original file line number Diff line number Diff line change 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" >
You can’t perform that action at this time.
0 commit comments