Skip to content

Commit

Permalink
Update build_and_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-SchaeferJ committed Oct 11, 2023
1 parent 8191545 commit c36eec7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@ jobs:

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Test with Code Coverage
run: |
dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet tool install --global dotnet-reportgenerator-globaltool
reportgenerator -reports:$(ls ./TestResults/**/coverage.opencover.xml | tr '\n' ';') -targetdir:./coverage -reporttypes:Html
reportgenerator -reports:"./TestResults/**/coverage.opencover.xml" -targetdir:"./coverage" -reporttypes:Html
continue-on-error: true

- name: Check Code Coverage
Expand All @@ -42,7 +39,6 @@ jobs:
coverage_percentage=$(grep -oP "Total\s*:\s*\K\d+\.\d+" "$coverage_file")
if (( $(echo "$coverage_percentage >= $coverage_threshold" | bc -l) )); then
echo "Code coverage is above $coverage_threshold% ($coverage_percentage%)"
exit 0
else
echo "Code coverage is below $coverage_threshold% ($coverage_percentage%), failing the build."
exit 1
Expand Down

0 comments on commit c36eec7

Please sign in to comment.