diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d59e50..8babc1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,22 +1,22 @@ name: PHP Tests -on: [push, pull_request] +on: [ push, pull_request ] jobs: build: runs-on: ubuntu-latest strategy: - matrix: - php: [ '8.2' ] - mysql-version: [ '5.7', '8.0', '8.4' ] + matrix: + php: [ '8.2', '8.3', '8.4' ] + mysql-version: [ 'mysql:5.5' ] services: mysql: - image: "mysql:${{ matrix.mysql-version }}" + image: "${{ matrix.mysql-version }}" env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: mysqlreplication_test ports: - - 3306/tcp + - 3310:3306 steps: - name: Checkout @@ -51,4 +51,4 @@ jobs: run: composer install --prefer-dist --no-progress --no-suggest - name: Run tests - run: vendor/bin/phpunit --coverage-text + run: MYSQL_PORT=3310 vendor/bin/phpunit --coverage-text diff --git a/src/MySQLReplication/Tools.php b/src/MySQLReplication/Tools.php new file mode 100644 index 0000000..f64db8e --- /dev/null +++ b/src/MySQLReplication/Tools.php @@ -0,0 +1,14 @@ +withUser('root') ->withHost('0.0.0.0') ->withPassword('root') - ->withPort(3306) + ->withPort((int)Tools::getFromEnv('MYSQL_PORT', 3306)) ->withEventsIgnore($this->getIgnoredEvents()); $this->connect(); + var_dump($this->mySQLReplicationFactory?->getServerInfo(), $this->configBuilder->build()); + if ($this->mySQLReplicationFactory?->getServerInfo()->versionRevision >= 8 && $this->mySQLReplicationFactory?->getServerInfo()->isGeneric()) { self::assertInstanceOf(RotateDTO::class, $this->getEvent()); }