Skip to content

Commit

Permalink
Add info about no of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Dec 19, 2024
1 parent 9305ba2 commit 64b9fd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/shared-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ jobs:

- name: Build and run unit tests
if: ${{ inputs.vulnerability_scan_only == 'false' }}
run: mvn -B clean compile test
working-directory: ${{ inputs.working_dir }}
run: |
tests_run=$(mvn -B clean compile test | tee build.log | grep "Tests run" | awk '{print $3}')
if [ "$tests_run" -eq 0 ]; then
echo "ERROR: No tests were run!"
exit 1
fi
echo "INFO: $tests_run tests were run!"
- name: Generate code coverage
if: ${{ inputs.vulnerability_scan_only == 'false' }}
Expand Down

0 comments on commit 64b9fd0

Please sign in to comment.