mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 12:56:30 +01:00
CI: Testing to add mysql.cnf file
This commit is contained in:
parent
ac933f48b2
commit
c03a0dc38a
4 changed files with 11 additions and 20 deletions
22
.github/actions/setup-database/action.yml
vendored
22
.github/actions/setup-database/action.yml
vendored
|
|
@ -43,36 +43,22 @@ runs:
|
|||
echo "MySQL is ready"
|
||||
shell: bash
|
||||
|
||||
- name: Set up MySQL Privileges and Character Set
|
||||
- name: Set up MySQL Privileges
|
||||
if: ${{ inputs.database == 'mysql' }}
|
||||
run: |
|
||||
# Set global character set and collation
|
||||
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
||||
SET GLOBAL character_set_server = 'utf8mb4';
|
||||
SET GLOBAL collation_server = 'utf8mb4_unicode_ci';
|
||||
EOF
|
||||
# Set InnoDB settings for utf8mb4 support (allows longer keys)
|
||||
# Note: innodb_large_prefix is ON by default in MySQL 8.0
|
||||
# Ensure default row format is DYNAMIC (default in MySQL 8.0, but explicit for clarity)
|
||||
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
||||
SET GLOBAL innodb_default_row_format = 'DYNAMIC';
|
||||
EOF
|
||||
# Note: MySQL server configuration (character set, collation, row format) is set
|
||||
# at container startup via the mysql.cnf config file mounted in the workflow
|
||||
# Ensure user exists and has proper privileges
|
||||
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
||||
CREATE USER IF NOT EXISTS 'evennia'@'%' IDENTIFIED BY 'password';
|
||||
GRANT ALL PRIVILEGES ON \`evennia%\`.* TO 'evennia'@'%';
|
||||
GRANT PROCESS ON *.* TO 'evennia'@'%';
|
||||
GRANT SESSION_VARIABLES_ADMIN ON *.* TO 'evennia'@'%';
|
||||
FLUSH PRIVILEGES;
|
||||
EOF
|
||||
# Set database character set
|
||||
# Set database character set (server defaults are set via config file, but ensure DB matches)
|
||||
mysql -u root -proot_password -h 127.0.0.1 evennia <<EOF
|
||||
ALTER DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
EOF
|
||||
# Verify settings are correct
|
||||
mysql -u root -proot_password -h 127.0.0.1 evennia <<EOF
|
||||
SELECT @@innodb_default_row_format, @@character_set_server, @@collation_server;
|
||||
EOF
|
||||
shell: bash
|
||||
|
||||
# get logs from db start
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ jobs:
|
|||
--health-interval=10s
|
||||
--health-timeout=5s
|
||||
--health-retries=3
|
||||
--mount type=bind,source=${{ github.workspace }}/.github/workflows/mysql.cnf,target=/etc/mysql/conf.d/custom.cnf,readonly
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
|
|||
5
.github/workflows/mysql.cnf
vendored
Normal file
5
.github/workflows/mysql.cnf
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[mysqld]
|
||||
character-set-server=utf8mb4
|
||||
collation-server=utf8mb4_unicode_ci
|
||||
innodb-default-row-format=DYNAMIC
|
||||
|
||||
3
.github/workflows/mysql_settings.py
vendored
3
.github/workflows/mysql_settings.py
vendored
|
|
@ -48,8 +48,7 @@ DATABASES = {
|
|||
"PORT": "", # use default port
|
||||
"OPTIONS": {
|
||||
"charset": "utf8mb4",
|
||||
# Note: innodb_default_row_format is set globally in setup-database action
|
||||
# This ensures all new tables use DYNAMIC format for utf8mb4 long keys
|
||||
# Note: MySQL server is configured with utf8mb4 and DYNAMIC row format at startup
|
||||
"init_command": (
|
||||
"SET collation_connection=utf8mb4_unicode_ci, "
|
||||
"sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue