Skip to content

Commit 86a9cdd

Browse files
committed
Using custom action to setup mysql
1 parent f114be4 commit 86a9cdd

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,19 @@ jobs:
99
php: [ '8.2', '8.3', '8.4' ]
1010
mysql-version: [ '5.7', '8.0', '8.4' ]
1111

12-
services:
13-
mysql:
14-
image: "mysql:${{ matrix.mysql-version }}"
15-
env:
16-
MYSQL_ROOT_PASSWORD: root
17-
MYSQL_DATABASE: mysqlreplication_test
18-
ports:
19-
- 3306/tcp
20-
options: >
21-
--mount type=bind,source=${{ github.workspace }}/my.cnf,target=/etc/mysql/conf.d/my.cnf
2212
steps:
2313
- name: Checkout
2414
uses: actions/checkout@v2
2515

26-
- name: Verify Connection
27-
env:
28-
PORT: ${{ job.services.mysql.ports[3306] }}
29-
run: |
30-
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
31-
sleep 1
32-
done
16+
- uses: shogo82148/actions-setup-mysql@v1
17+
with:
18+
mysql-version: "${{ matrix.mysql-version }}"
19+
my-cnf: |
20+
server-id=1
21+
binlog_format=row
22+
log_bin=ON
23+
binlog_rows_query_log_events=ON
24+
root-password: root
3325

3426
- name: Setup PHP, with composer and extensions
3527
uses: shivammathur/setup-php@v2
@@ -55,5 +47,3 @@ jobs:
5547

5648
- name: Run tests
5749
run: vendor/bin/phpunit --coverage-text
58-
env:
59-
PORT: ${{ job.services.mysql.ports[3306] }}

0 commit comments

Comments
 (0)