Skip to content

Commit

Permalink
edited
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Sulwer committed Jun 22, 2024
1 parent 2498d33 commit 31c576c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore RulesEngine.sln
Expand Down
16 changes: 16 additions & 0 deletions scripts/check-coverage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
param(
[Parameter(Mandatory=$true)][string] $reportPath,
[Parameter(Mandatory=$true)][decimal] $threshold
)


[XML]$report = Get-Content $reportPath;
[decimal]$coverage = [decimal]$report.coverage.'line-rate' * 100;

if ($coverage -lt $threshold) {
Write-Error "Coverage($coverage) is less than $threshold percent"
exit 1
}
else{
Write-Host "Coverage($coverage) is more than $threshold percent"
}
2 changes: 2 additions & 0 deletions scripts/generate-coverage-report.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dotnet tool restore
dotnet reportgenerator "-reports:**/coverage.cobertura.xml" "-targetdir:coveragereport" -reporttypes:"Html;lcov;Cobertura"

0 comments on commit 31c576c

Please sign in to comment.