Skip to content

Commit a6b8cb1

Browse files
Add wait step for app readiness in CI workflow
Added a step to wait for the application to be ready before running tests.
1 parent d920dcc commit a6b8cb1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/run_tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ jobs:
3131
- name: Start App
3232
run: dotnet run --project AudioCuesheetEditor &
3333

34+
- name: Wait for app to be ready
35+
run: |
36+
echo "Waiting for http://localhost:5132 to respond..."
37+
for i in {1..60}; do
38+
if curl -sSf http://localhost:5132 >/dev/null; then
39+
echo "App is ready"
40+
exit 0
41+
fi
42+
echo "Waiting for app to start ($i/60)..."
43+
sleep 2
44+
done
45+
echo "App failed to start after waiting" >&2
46+
exit 1
47+
shell: bash
48+
3449
- name: Run tests
3550
run: dotnet test
3651

0 commit comments

Comments
 (0)