Skip to content

Commit

Permalink
Check all stages pass in unit test (#1299)
Browse files Browse the repository at this point in the history
* Check all stages pass in unit test
Even if we have unit test failure, we are able to merge the PR as the last state gets skipped. This PR tries to explicit fail the final completion stage if there are failures in the previous stage.



---------

Co-authored-by: Sourav Maji <[email protected]>
  • Loading branch information
majisourav99 and Sourav Maji authored Nov 13, 2024
1 parent 37a6951 commit a9e775b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/VeniceCI-StaticAnalysisAndUnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,25 @@ jobs:
runs-on: ubuntu-latest
needs: [ValidateGradleWrapper, StaticAnalysis, UnitTestsAndCodeCoverage]
timeout-minutes: 120
if: success() || failure() # Always run this job, regardless of previous job status
steps:
- name: AllIsWell
shell: bash
- name: Check previous job statuses
run: |
echo "LGTM!"
if [ "${{ needs.ValidateGradleWrapper.result }}" != "success" ]; then
echo "ValidateGradleWrapper failed."
exit 1
fi
if [ "${{ needs.StaticAnalysis.result }}" != "success" ]; then
echo "StaticAnalysis failed."
exit 1
fi
if [ "${{ needs.UnitTestsAndCodeCoverage.result }}" != "success" ]; then
echo "UnitTestsAndCodeCoverage failed."
exit 1
fi
# If all previous jobs were successful, proceed
- name: Final Completion Check
run: echo "All checks passed successfully!"



1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ _site/
Gemfile.lock
.bundles_cache
docs/vendor/
clients/da-vinci-client/classHash*.txt

0 comments on commit a9e775b

Please sign in to comment.