Skip to content

Commit 0fdc22f

Browse files
authored
Switch to "native" mysql service
See mirromutth/mysql-action#34
1 parent f2c65e9 commit 0fdc22f

1 file changed

Lines changed: 26 additions & 10 deletions

File tree

.github/workflows/drupal-update.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ on:
7171
jobs:
7272
update_drupal:
7373
runs-on: ubuntu-latest
74+
services:
75+
mysql:
76+
image: mysql:8.0
77+
env:
78+
MYSQL_ROOT_PASSWORD: root
79+
ports:
80+
- 3306:3306
81+
options: >-
82+
--health-cmd="mysqladmin ping -h localhost -proot"
83+
--health-interval=10s
84+
--health-timeout=5s
85+
--health-retries=5
86+
7487
steps:
7588
- name: Checkout repository
7689
uses: actions/checkout@v4
@@ -104,17 +117,20 @@ jobs:
104117
COMPOSER_AUTH_JSON: |
105118
${{ steps.auth-json.outputs.auth_json }}
106119
107-
- name: Shutdown Ubuntu MySQL (SUDO)
108-
run: sudo service mysql stop
120+
- name: Wait for MySQL
121+
run: |
122+
until mysqladmin ping -h "127.0.0.1" -proot --silent; do
123+
sleep 2
124+
done
109125
110-
- name: Setup MySQL
111-
uses: mirromutth/mysql-action@v1.1
112-
with:
113-
host port: 3306
114-
mysql version: 8.0
115-
mysql database: drupal
116-
mysql user: drupal
117-
mysql password: drupal
126+
- name: Create DB and User
127+
run: |
128+
mysql -h 127.0.0.1 -uroot -proot <<EOF
129+
CREATE DATABASE drupal;
130+
CREATE USER 'drupal'@'%' IDENTIFIED BY 'drupal';
131+
GRANT ALL PRIVILEGES ON drupal.* TO 'drupal'@'%';
132+
FLUSH PRIVILEGES;
133+
EOF
118134
119135
- name: Create settings.php
120136
uses: DamianReeves/write-file-action@master

0 commit comments

Comments
 (0)