Skip to content

Commit

Permalink
add error if tests failed
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-nikonov authored Aug 15, 2024
1 parent 6fbe03c commit 9f3c567
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
dotnet test .\clio.tests\clio.tests.csproj -nowarn:none `
/p:CollectCoverage=true /p:CoverletOutputFormat=opencover `
/p:CoverletOutput=".\..\TestResults\coverage.opencover.xml";
dotnet build-server shutdown;
try {
dotnet test .\clio.tests\clio.tests.csproj -nowarn:none `
/p:CollectCoverage=true /p:CoverletOutputFormat=opencover `
/p:CoverletOutput=".\..\TestResults\coverage.opencover.xml";
dotnet build-server shutdown;
} catch {
Write-Error "Tests failed.";
exit 1;
}
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down

0 comments on commit 9f3c567

Please sign in to comment.