From 706fb4cd463f640e2d365a7b88578d4a7d4e3f71 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 19 Dec 2025 14:55:27 +0100 Subject: [PATCH] CI: Another try with inline mysql start --- .github/actions/setup-database/action.yml | 27 +++---------------- .../workflows/github_action_test_suite.yml | 3 +++ 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/actions/setup-database/action.yml b/.github/actions/setup-database/action.yml index ab1e10c05a..ee06374282 100644 --- a/.github/actions/setup-database/action.yml +++ b/.github/actions/setup-database/action.yml @@ -43,31 +43,12 @@ runs: echo "MySQL is ready" shell: bash - - name: Set up MySQL Configuration and Privileges + - name: Set up MySQL Privileges if: ${{ inputs.database == 'mysql' }} run: | - # Create MySQL config file inside the container and restart MySQL to apply settings - # This ensures settings are applied at server startup, similar to command-line arguments - CONTAINER_ID=$(docker ps --filter "ancestor=mysql:8.0" --format "{{.ID}}" | head -1) - if [ -n "$CONTAINER_ID" ]; then - # Create config file in container - docker exec $CONTAINER_ID sh -c 'printf "[mysqld]\ncharacter-set-server=utf8mb4\ncollation-server=utf8mb4_unicode_ci\ninnodb-default-row-format=DYNAMIC\n" > /etc/mysql/conf.d/custom.cnf' - # Restart MySQL to apply config (graceful shutdown and start) - docker exec $CONTAINER_ID sh -c 'mysqladmin -u root -proot_password shutdown' || true - sleep 2 - docker start $CONTAINER_ID - # Wait for MySQL to be ready again - until mysqladmin ping -h 127.0.0.1 -u root -proot_password --silent; do - sleep 1 - echo -n . - done - fi - # Also set global variables as a fallback (though config file should handle this) - mysql -u root -proot_password -h 127.0.0.1 mysql < /tmp/mysql-entrypoint.sh && chmod +x /tmp/mysql-entrypoint.sh && exec /tmp/mysql-entrypoint.sh" steps: - uses: actions/checkout@v4