File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171jobs :
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
You can’t perform that action at this time.
0 commit comments