From 50417d89706c0c958a9dad4a3f0fd9c792032030 Mon Sep 17 00:00:00 2001 From: Griatch Date: Thu, 27 Jun 2024 18:30:03 +0200 Subject: [PATCH] Testing to clean up mysql action too --- .../workflows/github_action_test_suite.yml | 34 ++++++++++++++----- .github/workflows/mysql_settings.py | 28 +++++++-------- .github/workflows/postgresql_settings.py | 4 +-- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/.github/workflows/github_action_test_suite.yml b/.github/workflows/github_action_test_suite.yml index d8b93afb2a..80beeb827e 100644 --- a/.github/workflows/github_action_test_suite.yml +++ b/.github/workflows/github_action_test_suite.yml @@ -36,9 +36,9 @@ jobs: postgres: image: postgres:12 env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres + POSTGRES_USER: evennia POSTGRES_DB: evennia + POSTGRES_PASSWORD: evennia options: >- --health-cmd pg_isready --health-interval 10s @@ -47,15 +47,31 @@ jobs: ports: - 5432:5432 + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: root_password + MYSQL_DATABASE: evennia + MYSQL_USER: evennia + MYSQL_PASSWORD: evennia + options: >- + --health-cmd "mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + --charset "utf8mb4" + --init_command "set collation_connection=utf8mb4_unicode_ci" + ports: + - 3306:3306 + steps: - uses: actions/checkout@v3 - - name: Set up database (${{ matrix.TESTING_DB }}) - if: matrix.TESTING_DB != 'postgresql' - uses: ./.github/actions/setup-database - with: - database: ${{ matrix.TESTING_DB }} - timeout-minutes: 5 + # - name: Set up database (${{ matrix.TESTING_DB }}) + # uses: ./.github/actions/setup-database + # with: + # database: ${{ matrix.TESTING_DB }} + # timeout-minutes: 5 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -93,6 +109,8 @@ jobs: env: POSTGRES_HOST: localhost POSTGRES_PORT: 5432 + MYSQL_HOST: 127.0.0.1 + MYSQL_PORT: 3306 # OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage # calculation! diff --git a/.github/workflows/mysql_settings.py b/.github/workflows/mysql_settings.py index b5525dcd74..ff9d317af8 100644 --- a/.github/workflows/mysql_settings.py +++ b/.github/workflows/mysql_settings.py @@ -43,20 +43,20 @@ DATABASES = { "ENGINE": "django.db.backends.mysql", "NAME": "evennia", "USER": "evennia", - "PASSWORD": "password", - "HOST": "127.0.0.1", - "PORT": "", # use default port - "OPTIONS": { - "charset": "utf8mb4", - "init_command": "set collation_connection=utf8mb4_unicode_ci", - }, - "TEST": { - "NAME": "evennia", - "OPTIONS": { - "charset": "utf8mb4", - "init_command": "set collation_connection=utf8mb4_unicode_ci", - }, - }, + "PASSWORD": "evennia", + "HOST": os.environ.get("MYSQL_HOST", "127.0.0.1"), + "PORT": os.environ.get("MYSQL_PORT", "3306"), +# "OPTIONS": { +# "charset": "utf8mb4", +# "init_command": "set collation_connection=utf8mb4_unicode_ci", +# }, +# "TEST": { +# "NAME": "evennia", +# "OPTIONS": { +# "charset": "utf8mb4", +# "init_command": "set collation_connection=utf8mb4_unicode_ci", +# }, +# }, } } diff --git a/.github/workflows/postgresql_settings.py b/.github/workflows/postgresql_settings.py index 2aaa453fe5..2e5ad4c4e6 100644 --- a/.github/workflows/postgresql_settings.py +++ b/.github/workflows/postgresql_settings.py @@ -42,8 +42,8 @@ DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": "evennia", - "USER": "postgres", # evennia - "PASSWORD": "postgres", + "USER": "evennia", + "PASSWORD": "evennia", "HOST": os.environ.get("POSTGRES_HOST", "localhost"), "PORT": os.environ.get("POSTGRES_PORT", "5432"), }