Skip to content

Commit 68b72a2

Browse files
author
Bizley
committed
MySQL 8 compatibility
1 parent a4610cb commit 68b72a2

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

.github/workflows/build-mysql.yml renamed to .github/workflows/build-mysql5.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php: ['7.2', '7.3', '7.4', '8.0']
17-
mysql: ['5.7', '8.0']
17+
mysql: ['5.7']
1818
services:
1919
mysql:
2020
image: mysql:${{ matrix.mysql }}
@@ -27,8 +27,6 @@ jobs:
2727
ports:
2828
- 3306/tcp
2929
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
30-
volumes:
31-
- /tests/docker/scripts:/docker-entrypoint-initdb.d
3230

3331
steps:
3432
- name: Checkout

.github/workflows/build-mysql8.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build with MySQL
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
Tests:
11+
name: PHP ${{ matrix.php }} + MySQL ${{ matrix.mysql }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: ['7.4', '8.0']
17+
mysql: ['8.0']
18+
services:
19+
mysql:
20+
image: mysql:${{ matrix.mysql }}
21+
env:
22+
MYSQL_ALLOW_EMPTY_PASSWORD: false
23+
MYSQL_ROOT_PASSWORD: password
24+
MYSQL_DATABASE: migration
25+
MYSQL_USER: migration
26+
MYSQL_PASSWORD: password
27+
ports:
28+
- 3306/tcp
29+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
35+
- name: Install PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php }}
39+
extensions: mbstring, intl, mysql
40+
coverage: none
41+
env:
42+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
update: true
44+
45+
- name: Start MySQL service
46+
run: sudo /etc/init.d/mysql start
47+
48+
- name: Get composer cache directory
49+
id: composer-cache
50+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
51+
52+
- name: Cache composer dependencies
53+
uses: actions/[email protected]
54+
with:
55+
path: ${{ steps.composer-cache.outputs.dir }}
56+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
57+
restore-keys: ${{ runner.os }}-composer-
58+
59+
- name: Install dependencies
60+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
61+
62+
- name: Prepare DB connections for tests
63+
run: printf "<?php\n\n\$config['mysql']['dsn']='mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=migration';\n" >> tests/config.local.php;
64+
65+
- name: PHPUnit tests
66+
run: vendor/bin/phpunit --exclude-group pgsql,sqlite

tests/docker/scripts/alter-user.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)