Skip to content

Commit 1ebcb2b

Browse files
committed
Run tests on both MariaDB & MySQL
1 parent f5ca391 commit 1ebcb2b

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/tests.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
name: Run Test Suite
1+
name: run tests
22
on:
33
push:
4-
branch-ignore:
5-
- 'master'
6-
- 'release/**'
4+
branches-ignore:
5+
- master
6+
- "release/**"
77
pull_request:
88
jobs:
9-
integration_tests:
9+
tests:
1010
runs-on: ubuntu-latest
1111
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
1212
services:
13+
mariadb:
14+
image: mariadb:10.2
15+
env:
16+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
17+
MYSQL_DATABASE: panel_test
18+
ports:
19+
- 3306
20+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
1321
mysql:
14-
image: mysql:5.7
22+
image: mysql:8
1523
env:
1624
MYSQL_ALLOW_EMPTY_PASSWORD: yes
1725
MYSQL_DATABASE: panel_test
@@ -21,7 +29,8 @@ jobs:
2129
strategy:
2230
fail-fast: false
2331
matrix:
24-
php: [7.4, 8.0]
32+
php: [ 7.4, 8.0 ]
33+
database: [ mysql, mariadb ]
2534
name: PHP ${{ matrix.php }}
2635
steps:
2736
- name: checkout
@@ -59,9 +68,15 @@ jobs:
5968
env:
6069
DB_CONNECTION: testing
6170
TESTING_DB_HOST: UNIT_NO_DB
62-
- name: execute integration tests
71+
- name: execute integration tests (mysql)
6372
run: vendor/bin/phpunit tests/Integration
64-
if: ${{ always() }}
73+
if: "${{ matrix.database }} == 'mysql'"
6574
env:
6675
TESTING_DB_PORT: ${{ job.services.mysql.ports[3306] }}
6776
TESTING_DB_USERNAME: root
77+
- name: execute integration tests (mariadb)
78+
run: vendor/bin/phpunit tests/Integration
79+
if: "${{ matrix.database }} == 'mariadb'"
80+
env:
81+
TESTING_DB_PORT: ${{ job.services.mariadb.ports[3306] }}
82+
TESTING_DB_USERNAME: root

0 commit comments

Comments
 (0)