-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move colima logic to script file
- Loading branch information
1 parent
d7f9be3
commit d722f12
Showing
3 changed files
with
52 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,37 +36,15 @@ jobs: | |
uses: docker-practice/[email protected] | ||
timeout-minutes: 30 | ||
|
||
- name: Run regtest setup | ||
run: cd docker && mkdir lnd && chmod 777 lnd && docker-compose up --quiet-pull -d | ||
|
||
- name: Install AppleSimulatorUtils | ||
run: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && brew install applesimutils | ||
|
||
- name: Run regtest setup | ||
run: cd docker && mkdir lnd && chmod 777 lnd && docker-compose up -d | ||
|
||
- name: Wait for electrum server | ||
- name: Wait for docker testing environment | ||
timeout-minutes: 20 | ||
run: | | ||
while true | ||
do | ||
for i in {1..60}; do | ||
nc -z '127.0.0.1' 60001 | ||
if [ $? -eq 0 ]; then | ||
echo "port is open" | ||
exit 0 | ||
fi | ||
echo "port is closed, attempt $i" | ||
sleep 1 | ||
done | ||
echo "colima restart" | ||
colima restart | ||
done | ||
# - name: Wait for bitcoind | ||
# timeout-minutes: 2 | ||
# run: while ! nc -z '127.0.0.1' 43782; do sleep 1; done | ||
|
||
# - name: Wait for electrum server | ||
# timeout-minutes: 2 | ||
# run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done | ||
run: ./.github/workflows/wait-for-env.sh | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# wait for the colima env to be ready, restart if not ready after 60 seconds | ||
|
||
ATTEMPTS=30 | ||
|
||
while true | ||
do | ||
echo "::group::check ports" | ||
|
||
echo -n "Bitcoin port 43782 " | ||
bitcoin=false | ||
for i in $(seq 1 $ATTEMPTS) | ||
do | ||
nc -z '127.0.0.1' 43782 > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo " success!" | ||
bitcoin=true | ||
break | ||
fi | ||
echo -n "." | ||
sleep 1 | ||
done | ||
|
||
if [ "$bitcoin" = true ] ; then | ||
echo -n "electrum port 60001 " | ||
for i in $(seq 1 $ATTEMPTS) | ||
do | ||
nc -z '127.0.0.1' 60001 > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo " success!" | ||
echo "::endgroup::" | ||
exit 0 | ||
fi | ||
echo -n "." | ||
sleep 1 | ||
done | ||
fi | ||
|
||
echo " failed!" | ||
echo "::endgroup::" | ||
|
||
echo "::group::colima restart" | ||
colima restart | ||
echo "::endgroup::" | ||
done | ||
|