Skip to content

Commit

Permalink
github: mariadb database healthcheck+naming
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 committed Apr 23, 2024
1 parent d1f17cf commit 595eaaf
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 595eaaf

Please sign in to comment.