Skip to content

Commit 7cb08aa

Browse files
committed
Test MariaDB and Valkey backends in CI
1 parent 4e18a0d commit 7cb08aa

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

.github/workflows/test-unit.yml

+24-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ jobs:
7272
mysql:
7373
image: mysql
7474
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db
75+
mariadb:
76+
image: mariadb
77+
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db
7578
postgres:
7679
image: postgres:12-alpine
7780
env:
@@ -85,6 +88,12 @@ jobs:
8588
image: redis:alpine
8689
redis3:
8790
image: redis:alpine
91+
valkey1:
92+
image: valkey/valkey:alpine
93+
valkey2:
94+
image: valkey/valkey:alpine
95+
valkey3:
96+
image: valkey/valkey:alpine
8897
memcached:
8998
image: memcached:alpine
9099
steps:
@@ -109,10 +118,11 @@ jobs:
109118
- name: Init
110119
run: |
111120
php -r '(new PDO("mysql:host=mysql", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");'
121+
php -r '(new PDO("mysql:host=mariadb", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");'
112122
php -r '(new PDO("pgsql:host=postgres;dbname=test_db", "test_user", "test_pass"))->exec("ALTER ROLE test_user CONNECTION LIMIT 1");'
113123
if [ -n "$LOG_COVERAGE" ]; then mkdir coverage; fi
114124
115-
- name: "Run tests"
125+
- name: "Run tests 1/2"
116126
env:
117127
MYSQL_DSN: "mysql:host=mysql;dbname=test_db"
118128
MYSQL_USER: test_user
@@ -125,6 +135,19 @@ jobs:
125135
run: |
126136
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
127137
138+
- name: "Run tests 2/2"
139+
env:
140+
MYSQL_DSN: "mysql:host=mariadb;dbname=test_db"
141+
MYSQL_USER: test_user
142+
MYSQL_PASSWORD: test_pass
143+
PGSQL_DSN: "pgsql:host=postgres;dbname=test_db"
144+
PGSQL_USER: test_user
145+
PGSQL_PASSWORD: test_pass
146+
REDIS_URIS: "redis://valkey1,redis://valkey2,redis://valkey3"
147+
MEMCACHE_HOST: memcached
148+
run: |
149+
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
150+
128151
- name: Upload coverage (only for coverage)
129152
if: env.LOG_COVERAGE && false # TODO
130153
uses: codecov/codecov-action@v5

0 commit comments

Comments
 (0)