Skip to content

Commit c9fa8f0

Browse files
committed
Use mysql setup action
1 parent e461de8 commit c9fa8f0

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

.github/workflows/build-install.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ jobs:
1010
name: Drupal (PHP ${{ matrix.php-versions }})
1111
runs-on: ubuntu-latest
1212

13-
# Docs: https://docs.github.com/en/actions/using-containerized-services
14-
services:
15-
mysql:
16-
image: mysql:5.7
17-
env:
18-
MYSQL_ALLOW_EMPTY_PASSWORD: true
19-
MYSQL_ROOT_PASSWORD:
20-
ports:
21-
- 3306/tcp
22-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2313
strategy:
2414
fail-fast: false
2515
matrix:
@@ -35,14 +25,18 @@ jobs:
3525
php-version: ${{ matrix.php-versions }}
3626
tools: phpunit-bridge
3727
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
38-
coverage: xdebug
28+
29+
- name: Setup MySQL
30+
uses: shogo82148/actions-setup-mysql@v1
31+
with:
32+
mysql-version: "5.7"
33+
root-password: root
3934

4035
# Local MySQL service in GitHub hosted environments is disabled by default.
4136
# If you are using it instead of service containers, make sure you start it.
4237
# - name: Start mysql service
4338
# run: sudo systemctl start mysql.service
44-
45-
- name: Start mysql service
39+
- name: Start mysql service and create test DB
4640
run: |
4741
sudo systemctl start mysql.service
4842
mysql -e 'CREATE USER "drupal"@"127.0.0.1" IDENTIFIED BY "drupal";' -uroot

0 commit comments

Comments
 (0)