Skip to content

Commit

Permalink
github: mariadb database healthcheck+naming (laravel#51192)
Browse files Browse the repository at this point in the history
MariaDB's container has a healthcheck.sh script that can be used.
mysqladmin ping has flaw that it checks unix socket first which
means it can return true while the database is been bootstrapped.

Also use the MariaDB names as we haven't been MySQL for a while.
  • Loading branch information
grooverdan authored Apr 24, 2024
1 parent d1f17cf commit 6d598f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ jobs:
runs-on: ubuntu-22.04

services:
mysql:
mariadb:
image: mariadb:10
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
MARIADB_DATABASE: laravel
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: true
Expand Down

0 comments on commit 6d598f5

Please sign in to comment.