Skip to content

Commit 3cbe1db

Browse files
committed
feat: wait for API to be ready
1 parent 2e804ea commit 3cbe1db

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/postman.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,25 @@ jobs:
5151
run: |
5252
cd apl-core
5353
npm install
54-
npm run server > /dev/null 2>&1 &
54+
npm run server > $GITHUB_WORKSPACE/core.log 2>&1 &
5555
- name: Start api
5656
run: |
5757
npm install
5858
cp .env.sample .env
59-
npm run dev
59+
npm run dev > $GITHUB_WORKSPACE/api.log 2>&1 &
60+
- name: Wait for api
61+
run: |
62+
echo "Waiting for API to be ready..."
63+
while ! curl -s -f -o /dev/null http://localhost:8080/v2/builds; do
64+
sleep 10
65+
done
66+
echo "API is ready!"
67+
- name: Show logs
68+
run: |
69+
echo "::group::Core Server Logs"
70+
cat $GITHUB_WORKSPACE/core.log || echo "No core log found"
71+
echo "::endgroup::"
72+
73+
echo "::group::API Logs"
74+
cat $GITHUB_WORKSPACE/api.log || echo "No api log found"
75+
echo "::endgroup::"

src/.DS_Store

8 KB
Binary file not shown.

0 commit comments

Comments
 (0)