2020 fail-fast : false
2121 matrix :
2222 php-version : [ '8.1', '8.2', '8.3', '8.4' ]
23- db-type : [ sqlite, mysql, pgsql ]
23+ db-type : [ sqlite, mysql, mariadb, pgsql ]
2424
2525 services :
26+ mariadb :
27+ image : mariadb:11
28+ env :
29+ MARIADB_ROOT_PASSWORD : root
30+ MARIADB_DATABASE : cakephp
31+ ports :
32+ - 3307:3306
33+ options : >-
34+ --health-cmd "mariadb-admin ping -h localhost -proot"
35+ --health-interval 10s
36+ --health-timeout 5s
37+ --health-retries 5
2638 postgres :
2739 image : postgres:14
2840 env :
4456 sudo service mysql start
4557 mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
4658
59+ - name : Install MariaDB dump tools
60+ if : matrix.db-type == 'mariadb'
61+ run : sudo apt-get install mariadb-client
62+
4763 - name : Setup Postgres
4864 if : matrix.db-type == 'pgsql'
4965 run : |
5773 uses : shivammathur/setup-php@v2
5874 with :
5975 php-version : ${{ matrix.php-version }}
60- extensions : mbstring, intl, pdo_ ${{ matrix.db-type }}
76+ extensions : mbstring, intl, ${{ matrix.db-type == 'sqlite' && 'pdo_sqlite' || matrix.db-type == 'pgsql' && 'pdo_pgsql' || 'pdo_mysql' }}
6177 ini-values : zend.assertions=1
6278 coverage : pcov
6379
7591 if [[ ${{ matrix.db-type }} == 'mysql' ]]; then
7692 export DB_URL=mysql://root:root@127.0.0.1/cakephp
7793 fi
94+ if [[ ${{ matrix.db-type }} == 'mariadb' ]]; then
95+ export DB_URL=mysql://root:root@127.0.0.1:3307/cakephp
96+ fi
7897 if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then
7998 export DB_URL=postgres://postgres:postgres@127.0.0.1/postgres
8099 fi
@@ -107,7 +126,7 @@ jobs:
107126 uses : ramsey/composer-install@v3
108127
109128 - name : Install PHP tools with phive.
110- run : " phive install --trust-gpg-keys 'CF1A108D0E7AE720, 51C67305FFC2E5C0,12CE0F1D262429A5'"
129+ run : " phive install --trust-gpg-keys '51C67305FFC2E5C0,12CE0F1D262429A5'"
111130
112131 - name : Run phpcs
113132 if : always()
@@ -120,4 +139,3 @@ jobs:
120139 - name : Run phpstan
121140 if : always()
122141 run : tools/phpstan analyse --error-format=github
123-
0 commit comments