Skip to content

Commit

Permalink
actions/macos: be more robust in waiting for the service to be up
Browse files Browse the repository at this point in the history
  • Loading branch information
sando38 committed Jul 26, 2023
1 parent 6a68850 commit 51cfef7
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,30 @@ jobs:
run: brew test --verbose eturnal
- name: Start eturnal service
run: brew services start eturnal
- name: Wait shortly
run: sleep 10
- name: Check if eturnal is up & running ...
run: |
max_iterations=60
iterations=0
while true
do
iterations="$(expr $iterations + 1)"
echo ">> Attempt $iterations from $max_iterations"
sleep 1
if [ "$(eturnalctl ping)" = 'pong' ]; then
echo '>> eturnal is running! ...'
break
fi
if [ "$iterations" -ge "$max_iterations" ]; then
echo '>> Loop Timeout!'
exit 1
fi
done
- name: Print eturnal info
run: eturnalctl info
- name: Create test credentials
run: $(brew --prefix)/opt/eturnal/bin/eturnalctl credentials
- name: Test eturnalctl on $PATH
run: eturnalctl info
- name: Stop eturnal service
run: brew services stop eturnal
- name: Lint formula
Expand Down

0 comments on commit 51cfef7

Please sign in to comment.