From f369081270861476b53ab0071993cd42a394309a Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 22 Dec 2025 09:25:32 +0100 Subject: [PATCH] CI: Using an action for mysql setup instead of a docker image --- .github/actions/setup-database/action.yml | 24 ++++++------- .../workflows/github_action_test_suite.yml | 35 +++++++------------ .github/workflows/mysql.cnf | 5 --- 3 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/mysql.cnf diff --git a/.github/actions/setup-database/action.yml b/.github/actions/setup-database/action.yml index ee06374282..f46ed19c3c 100644 --- a/.github/actions/setup-database/action.yml +++ b/.github/actions/setup-database/action.yml @@ -35,40 +35,36 @@ runs: - name: Wait for MySQL to be ready if: ${{ inputs.database == 'mysql' }} run: | - # Wait for MySQL service container to be healthy - until mysqladmin ping -h 127.0.0.1 -u root -proot_password --silent; do + # Wait for MySQL server to be ready + until mysqladmin ping -u root -proot_password --silent; do sleep 1 echo -n . done echo "MySQL is ready" shell: bash - - name: Set up MySQL Privileges + - name: Set up MySQL Database and Privileges if: ${{ inputs.database == 'mysql' }} run: | # Note: MySQL server configuration (character set, collation, row format) is set - # at container startup via custom entrypoint script that passes command-line arguments - # to mysqld, similar to how mirromutth/mysql-action works. - # Ensure user exists and has proper privileges - mysql -u root -proot_password -h 127.0.0.1 mysql <- - --health-cmd="mysqladmin ping -h localhost" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - --entrypoint="/bin/bash" - -c - "printf '#!/bin/bash\nexec /usr/local/bin/docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb-default-row-format=DYNAMIC \"\$@\"\n' > /tmp/mysql-entrypoint.sh && chmod +x /tmp/mysql-entrypoint.sh && exec /tmp/mysql-entrypoint.sh" steps: - uses: actions/checkout@v4 - - name: Install MySQL client - run: | - sudo apt-get update - sudo apt-get install -y default-mysql-client - timeout-minutes: 2 + - name: Set up MySQL + uses: shogo82148/actions-setup-mysql@v1 + with: + mysql-version: "8.0" + root-password: root_password + user: evennia + password: password + my-cnf: | + [mysqld] + character-set-server=utf8mb4 + collation-server=utf8mb4_unicode_ci + innodb-default-row-format=DYNAMIC - name: Set up database (mysql) uses: ./.github/actions/setup-database diff --git a/.github/workflows/mysql.cnf b/.github/workflows/mysql.cnf deleted file mode 100644 index 80e9c867c0..0000000000 --- a/.github/workflows/mysql.cnf +++ /dev/null @@ -1,5 +0,0 @@ -[mysqld] -character-set-server=utf8mb4 -collation-server=utf8mb4_unicode_ci -innodb-default-row-format=DYNAMIC -