Skip to content

Commit

Permalink
fix: move colima logic to script file
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Dec 6, 2023
1 parent d7f9be3 commit 02a548c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fetch-depth: 1

- name: Run regtest setup
run: cd docker && docker compose up -d
run: cd docker && docker compose up --quiet-pull -d

- name: Wait for bitcoind
run: |
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/wait-for-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# wait for the colima env to be ready, restart if not ready after 60 seconds
while true
do
echo "::group::check ports"
for i in {1..30}
do
nc -z '127.0.0.1' 43782 > /dev/null 2>&1 && nc -z '127.0.0.1' 60002 > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo ""
echo "ports are open"
echo "::endgroup::"
exit 0
fi
echo -n "."
sleep 1
done
echo "::endgroup::"
echo "::group::colima restart"
colima restart
echo "::endgroup::"
done

0 comments on commit 02a548c

Please sign in to comment.