Skip to content

Commit 72b9dc4

Browse files
authored
Add MySQL debugging
1 parent d9f6b35 commit 72b9dc4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/spio.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
DB_NAME: wordpress_test
3333
DB_USER: root
3434
DB_PASS: password
35-
DB_HOST: 127.0.0.1
35+
DB_HOST: 127.0.0.1:3306
3636
WP_RUN_CORE_TESTS: 1
3737

3838
steps:
@@ -59,6 +59,19 @@ jobs:
5959
- name: Install Composer dependencies
6060
run: composer install --no-interaction --prefer-dist
6161

62+
- name: Test that MySQL works properly
63+
run: |
64+
timeout=30
65+
while ! mysqladmin ping -h "127.0.0.1" --user="$DB_USER" --password="$DB_PASS" --silent; do
66+
>&2 echo "MySQL is unavailable - sleeping"
67+
sleep 1
68+
timeout=$((timeout-1))
69+
if [ $timeout -eq 0 ]; then
70+
>&2 echo "MySQL still not responding, aborting."
71+
exit 1
72+
fi
73+
done
74+
6275
- name: Install WordPress Unit Test Suite
6376
run: |
6477
mkdir -p "${WP_TESTS_DIR}"

0 commit comments

Comments
 (0)