Skip to content

Commit d449f3f

Browse files
committed
chore: build.ps1 should exit if any command fails
1 parent 59392d4 commit d449f3f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

build.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,20 @@ if ($null -eq (Get-Command "dotnet" -ErrorAction Ignore)) {
99
}
1010

1111
dotnet tool restore
12+
if ($LastExitCode -ne 0) { exit $LastExitCode }
13+
1214
dotnet restore
15+
if ($LastExitCode -ne 0) { exit $LastExitCode }
16+
1317
dotnet build --no-restore --configuration Release
18+
if ($LastExitCode -ne 0) { exit $LastExitCode }
19+
1420
dotnet test --no-build --configuration Release --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --coverage-settings .runsettings
21+
if ($LastExitCode -ne 0) { exit $LastExitCode }
22+
1523
dotnet reportgenerator -reports:**/TestResults/**/coverage.cobertura.xml -targetdir:CoverageReport -reporttypes:"TextSummary" -verbosity:off
24+
if ($LastExitCode -ne 0) { exit $LastExitCode }
25+
1626
Write-Host ""
1727
Write-Host "Code coverage report:" -ForegroundColor DarkGreen
1828
Write-Host ""

0 commit comments

Comments
 (0)