Skip to content

Commit 920e3a2

Browse files
authored
exclude mysql ver 5.7
- add more workflow mysql 5.7, mysql 8, mariadb 10 - add group exclude for mysql 5,7
1 parent 63e1cd5 commit 920e3a2

File tree

3 files changed

+94
-6
lines changed

3 files changed

+94
-6
lines changed

.github/workflows/database.yml

+89-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Database
22

3-
on:
3+
on:
44
push:
55
paths:
66
- ".github/workflows/database.yml"
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
mysql_57:
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020

2121
services:
2222
mysql:
@@ -35,7 +35,7 @@ jobs:
3535

3636
steps:
3737
- name: Checkout code
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939

4040
- name: Setup PHP
4141
uses: shivammathur/setup-php@v2
@@ -46,7 +46,50 @@ jobs:
4646
coverage: none
4747

4848
- name: Install dependencies
49-
uses: nick-fields/retry@v2
49+
uses: nick-fields/retry@v3
50+
with:
51+
timeout_minutes: 5
52+
max_attempts: 5
53+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
54+
55+
- name: Execute tests
56+
run: vendor/bin/phpunit tests/DataBase --exclude-group not-for-mysql5.7
57+
env:
58+
DB_CONNECTION: mysql
59+
DB_USERNAME: root
60+
61+
mysql_8:
62+
runs-on: ubuntu-24.04
63+
64+
services:
65+
mysql:
66+
image: mysql:8
67+
env:
68+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
69+
MYSQL_DATABASE: forge
70+
ports:
71+
- 3306:3306
72+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
73+
74+
strategy:
75+
fail-fast: true
76+
77+
name: MySQL 8
78+
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@v4
82+
83+
- name: Setup PHP
84+
uses: shivammathur/setup-php@v2
85+
with:
86+
php-version: 8.1
87+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql
88+
tools: composer:v2
89+
coverage: none
90+
91+
- name: Install dependencies
92+
uses: nick-fields/retry@v3
5093
with:
5194
timeout_minutes: 5
5295
max_attempts: 5
@@ -57,3 +100,45 @@ jobs:
57100
env:
58101
DB_CONNECTION: mysql
59102
DB_USERNAME: root
103+
104+
mariadb:
105+
runs-on: ubuntu-24.04
106+
107+
services:
108+
mariadb:
109+
image: mariadb:10
110+
env:
111+
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
112+
MARIADB_DATABASE: forge
113+
ports:
114+
- 3306:3306
115+
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
116+
117+
strategy:
118+
fail-fast: true
119+
120+
name: MariaDB 10
121+
122+
steps:
123+
- name: Checkout code
124+
uses: actions/checkout@v4
125+
126+
- name: Setup PHP
127+
uses: shivammathur/setup-php@v2
128+
with:
129+
php-version: 8.1
130+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
131+
tools: composer:v2
132+
coverage: none
133+
134+
- name: Install dependencies
135+
uses: nick-fields/retry@v3
136+
with:
137+
timeout_minutes: 5
138+
max_attempts: 5
139+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
140+
141+
- name: Execute tests
142+
run: vendor/bin/phpunit tests/DataBase
143+
env:
144+
DB_CONNECTION: mariadb

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"test:refacto": "rector --dry-run",
7676
"test:lint": "php-cs-fixer fix -v --dry-run --diff",
7777
"test:types": "phpstan analyse --ansi --memory-limit=-1 --debug",
78-
"test:unit": "phpunit --testdox --exclude-group database",
78+
"test:unit": "phpunit --testdox --exclude-group database,not-for-mysql5.7",
7979
"test:release": "php ./bin/split-repo.php validate",
8080
"test:dev": [
8181
"@test:refacto",
@@ -88,7 +88,7 @@
8888
"rector --dry-run",
8989
"php-cs-fixer fix -v --dry-run",
9090
"phpstan analyse --ansi --memory-limit=-1",
91-
"phpunit --exclude-group database",
91+
"phpunit --exclude-group database,not-for-mysql5.7",
9292
"php ./bin/split-repo.php validate"
9393
]
9494
},

tests/DataBase/RealDatabase/Schema/Table/AlterTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function itCanExcuteQueryUsingDropColumn()
8181
* @test
8282
*
8383
* @group database
84+
* @group not-for-mysql5.7
8485
*/
8586
public function itCanExcuteQueryUsingRenameColumn()
8687
{
@@ -98,6 +99,7 @@ public function itCanExcuteQueryUsingRenameColumn()
9899
* @test
99100
*
100101
* @group database
102+
* @group not-for-mysql5.7
101103
*/
102104
public function itCanExcuteQueryUsingRenamesColumn()
103105
{
@@ -116,6 +118,7 @@ public function itCanExcuteQueryUsingRenamesColumn()
116118
* @test
117119
*
118120
* @group database
121+
* @group not-for-mysql5.7
119122
*/
120123
public function itCanExcuteQueryUsingAlterColumn()
121124
{

0 commit comments

Comments
 (0)