Test both MariaDB and MySQL (#12547)

This commit is contained in:
Jellyfrog 2021-02-22 15:20:51 +01:00 committed by GitHub
parent 1f68b7b0ed
commit 34885b0a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,22 +30,26 @@ jobs:
name: Unit
skip-style-check: 1
skip-web-check: 1
database: mariadb:10.5
-
php-version: 7.4
name: Style and Web
skip-unit-check: 1
database: mysql:5.7
-
php-version: 7.3
name: Unit
skip-style-check: 1
skip-web-check: 1
database: mysql:5.7
-
php-version: 7.3
name: Style and Web
skip-unit-check: 1
database: mysql:8.0
services:
mysql:
image: mysql:5.7
database:
image: ${{ matrix.database }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: librenms_phpunit_78hunjuybybh
@ -122,13 +126,13 @@ jobs:
APP_ENV=testing
DB_DRIVER=mysql
DB_HOST=127.0.0.1
DB_PORT=${{ job.services.mysql.ports[3306] }}
DB_PORT=${{ job.services.database.ports[3306] }}
DB_DATABASE=librenms_phpunit_78hunjuybybh
DB_USERNAME=librenms
DB_PASSWORD=librenms
DB_TEST_DRIVER=mysql
DB_TEST_HOST=127.0.0.1
DB_TEST_PORT=${{ job.services.mysql.ports[3306] }}
DB_TEST_PORT=${{ job.services.database.ports[3306] }}
DB_TEST_DATABASE=librenms_phpunit_78hunjuybybh
DB_TEST_USERNAME=librenms
DB_TEST_PASSWORD=librenms
@ -145,13 +149,20 @@ jobs:
-
name: Ensure MySQL is up
env:
PORT: ${{ job.services.mysql.ports[3306] }}
PORT: ${{ job.services.database.ports[3306] }}
run: |
mysqladmin -h"127.0.0.1" -P"$PORT" --user=librenms --password=librenms ping --wait=5
-
name: Set MySQL authentication plugin
if: matrix.database == 'mysql:8.0'
env:
PORT: ${{ job.services.database.ports[3306] }}
run: |
mysql -h"127.0.0.1" -P"$PORT" --user=root -e "ALTER USER 'librenms'@'%' IDENTIFIED WITH mysql_native_password BY 'librenms'"
-
name: Set MySQL collate
env:
PORT: ${{ job.services.mysql.ports[3306] }}
PORT: ${{ job.services.database.ports[3306] }}
run: |
mysql -h"127.0.0.1" -P"$PORT" --user=librenms --password=librenms -e 'ALTER DATABASE librenms_phpunit_78hunjuybybh CHARACTER SET utf8 COLLATE utf8_unicode_ci;'
-