Skip to content

Commit

Permalink
Check shell exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieobject committed Mar 2, 2024
1 parent fdcd861 commit 7e49942
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ jobs:
# retries are added due to test failures with dependencies
- name: Run tests
run: script/run_tests.sh
# continue-on-error: true

# Continue on error to capture the exit status
- name: Check exit status
run: |
if [ $? -eq 0 ]; then
echo "Workflow succeeded."
else
echo "Workflow failed."
exit 1
fi
# - name: Stop local test server
# run: docker-compose -p xmtp-ios -f dev/local/docker-compose.yml down
7 changes: 6 additions & 1 deletion script/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ do
echo "Test Succeeded"
break
else
echo "Test Suite Failed. Retrying..."
((retries=retries+1))
echo "Test Suite Failed. Retrying Attempt ($retries) ..."
fi
done

if [ $retries -ge 5 ]; then
echo "Maximum number of retries exceeded. Exiting with status code 1."
exit 1
fi

0 comments on commit 7e49942

Please sign in to comment.