Skip to content

Commit 970fd7d

Browse files
Fix Copilot dashboard health checks
1 parent 1f9e78e commit 970fd7d

1 file changed

Lines changed: 32 additions & 7 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
permissions:
1818
contents: read
1919

20+
env:
21+
APP_PORT: 18280
22+
2023
steps:
2124
- name: Checkout code
2225
uses: actions/checkout@v5
@@ -28,7 +31,12 @@ jobs:
2831
2932
- name: Prepare dashboard and queue worker
3033
run: |
31-
docker compose -f .devcontainer/docker/docker-compose.yml run --rm --no-deps --entrypoint bash laravel -lc '
34+
docker compose -f .devcontainer/docker/docker-compose.yml run --rm --no-deps \
35+
-e APP_ENV=local \
36+
-e APP_DEBUG=true \
37+
-e APP_URL=http://127.0.0.1:${APP_PORT} \
38+
-e ASSET_URL=http://127.0.0.1:${APP_PORT} \
39+
--entrypoint bash laravel -lc '
3240
cd /var/www/html &&
3341
git config --global --add safe.directory /var/www/html &&
3442
mkdir -p workbench/bootstrap/cache &&
@@ -43,7 +51,12 @@ jobs:
4351
./vendor/bin/testbench migrate:fresh --database=sqlite &&
4452
./vendor/bin/testbench waterline:publish
4553
'
46-
docker compose -f .devcontainer/docker/docker-compose.yml run -d --name waterline-copilot-app --service-ports --no-deps --entrypoint bash laravel -lc '
54+
docker compose -f .devcontainer/docker/docker-compose.yml run -d --name waterline-copilot-app --service-ports --no-deps \
55+
-e APP_ENV=local \
56+
-e APP_DEBUG=true \
57+
-e APP_URL=http://127.0.0.1:${APP_PORT} \
58+
-e ASSET_URL=http://127.0.0.1:${APP_PORT} \
59+
--entrypoint bash laravel -lc '
4760
cd /var/www/html &&
4861
git config --global --add safe.directory /var/www/html &&
4962
mkdir -p workbench/bootstrap/cache &&
@@ -54,7 +67,12 @@ jobs:
5467
chmod -R ug+rwX workbench/bootstrap/cache workbench/storage &&
5568
php -S 0.0.0.0:80 -t workbench/public workbench/server.php
5669
'
57-
docker compose -f .devcontainer/docker/docker-compose.yml run -d --name waterline-copilot-worker --no-deps --entrypoint bash laravel -lc '
70+
docker compose -f .devcontainer/docker/docker-compose.yml run -d --name waterline-copilot-worker --no-deps \
71+
-e APP_ENV=local \
72+
-e APP_DEBUG=true \
73+
-e APP_URL=http://127.0.0.1:${APP_PORT} \
74+
-e ASSET_URL=http://127.0.0.1:${APP_PORT} \
75+
--entrypoint bash laravel -lc '
5876
cd /var/www/html &&
5977
git config --global --add safe.directory /var/www/html &&
6078
mkdir -p workbench/bootstrap/cache &&
@@ -66,25 +84,32 @@ jobs:
6684
./vendor/bin/testbench queue:work --tries=1 --timeout=90
6785
'
6886
for attempt in $(seq 1 30); do
69-
if curl --fail --silent http://127.0.0.1:18280 > /dev/null; then
87+
if curl --fail --silent --show-error http://127.0.0.1:${APP_PORT}/waterline > /dev/null; then
7088
break
7189
fi
7290
sleep 2
7391
done
74-
curl --fail --silent http://127.0.0.1:18280 > /dev/null
92+
curl --fail --silent --show-error http://127.0.0.1:${APP_PORT}/waterline > /dev/null
7593
docker exec waterline-copilot-worker bash -lc 'ps -ef | grep "[q]ueue:work"'
76-
docker compose -f .devcontainer/docker/docker-compose.yml run --rm --no-deps --entrypoint bash laravel -lc '
94+
docker compose -f .devcontainer/docker/docker-compose.yml run --rm --no-deps \
95+
-e APP_ENV=local \
96+
-e APP_DEBUG=true \
97+
-e APP_URL=http://127.0.0.1:${APP_PORT} \
98+
-e ASSET_URL=http://127.0.0.1:${APP_PORT} \
99+
--entrypoint bash laravel -lc '
77100
cd /var/www/html &&
78101
./vendor/bin/testbench workflow:create-test &&
79102
./vendor/bin/testbench workflow:create-test-parent &&
80103
./vendor/bin/testbench workflow:create-test-continue-as-new
81104
'
82105
sleep 5
83-
curl --fail --silent http://127.0.0.1:18280/waterline > /dev/null
106+
curl --fail --silent --show-error http://127.0.0.1:${APP_PORT}/waterline/api/stats > /dev/null
84107
85108
- name: Show compose logs if checks fail
86109
if: failure()
87110
run: |
111+
curl --include --silent --show-error http://127.0.0.1:${APP_PORT}/waterline || true
112+
curl --include --silent --show-error http://127.0.0.1:${APP_PORT}/waterline/api/stats || true
88113
docker compose -f .devcontainer/docker/docker-compose.yml logs --no-color
89114
docker logs waterline-copilot-app || true
90115
docker logs waterline-copilot-worker || true

0 commit comments

Comments
 (0)