From caae1d572026bb470abf71452df54adcebb79212 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 13 Feb 2026 09:19:30 +0800 Subject: [PATCH] MDL-87946 github: Update GHA Database connections Both the pgsql and mysql steps we were using use `docker:stable`, which has been abandoned and is not a recommended approach. They are also both abandoned. This commit moves to using a service entry for postgres; and a manual step for mysql. We can't use the services entry for MySQL because GHA does not support providing arguments to service containers. --- .github/workflows/push.yml | 41 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2a123c838ef..3ef84934ee6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -56,6 +56,14 @@ jobs: image: redis ports: - 6379:6379 + postgres: + image: ${{ matrix.db == 'pgsql' && 'postgres:15' || '' }} + env: + POSTGRES_DB: test + POSTGRES_USER: test + POSTGRES_PASSWORD: test + ports: + - 5432:5432 strategy: fail-fast: false matrix: @@ -71,27 +79,20 @@ jobs: db: pgsql steps: - - name: Setting up DB mysql + - name: Run MySQL Server if: ${{ matrix.db == 'mysqli' }} - uses: moodlehq/mysql-action@v1 - with: - collation server: utf8mb4_bin - mysql version: 8.4 - mysql database: test - mysql user: test - mysql password: test - use tmpfs: true - tmpfs size: '1024M' - extra conf: --skip-log-bin - - - name: Setting up DB pgsql - if: ${{ matrix.db == 'pgsql' }} - uses: m4nu56/postgresql-action@v1 - with: - postgresql version: 15 - postgresql db: test - postgresql user: test - postgresql password: test + run: | + docker run --rm \ + -e MYSQL_DATABASE=test \ + -e MYSQL_USER=test \ + -e MYSQL_PASSWORD=test \ + -e MYSQL_ROOT_PASSWORD=test \ + -p 3306:3306 \ + -d \ + --tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024M \ + mysql:8.4 \ + --skip-log-bin \ + --collation-server=utf8mb4_bin - name: Configuring git vars uses: rlespinasse/github-slug-action@v4