Skip to content

Commit

Permalink
Merge branch '3.8.x' into 3.9.x
Browse files Browse the repository at this point in the history
* 3.8.x:
  Properly handle MySQL error code 4031 from PHP 8.4 (doctrine#6363)
  CI: Add MySQL 9, reduce test matrix (doctrine#6462)
  Complete sentence
  mariadb: add nightly workflow to facilitate mariadb "nightlies" (doctrine#6435)
  • Loading branch information
derrabus committed Jul 23, 2024
2 parents b1da9ad + 349c833 commit 0f5661e
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 32 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,57 +378,34 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.1"
- "8.3"
mysql-version:
- "5.7"
- "8.0"
- "9.0"
extension:
- "mysqli"
- "pdo_mysql"
config-file-suffix:
- ""
include:
- mysql-version: "8.0"
# https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions
custom-entrypoint: >-
--entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
- config-file-suffix: "-tls"
php-version: "7.4"
mysql-version: "8.0"
extension: "mysqli"
- php-version: "8.2"
- php-version: "7.4"
mysql-version: "8.0"
extension: "mysqli"
custom-entrypoint: >-
--entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
- php-version: "8.2"
- php-version: "7.4"
mysql-version: "8.0"
extension: "pdo_mysql"
custom-entrypoint: >-
--entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
- php-version: "8.3"
mysql-version: "8.0"
extension: "mysqli"
# Workaround for https://bugs.mysql.com/114876
- php-version: "8.3"
mysql-version: "8.0"
extension: "pdo_mysql"
- php-version: "7.4"
mysql-version: "8.4"
extension: "mysqli"
custom-entrypoint: >-
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
- php-version: "7.4"
mysql-version: "8.4"
extension: "pdo_mysql"
custom-entrypoint: >-
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
- php-version: "8.1"
mysql-version: "8.4"
extension: "mysqli"
custom-entrypoint: >-
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
- php-version: "8.1"
- php-version: "8.3"
mysql-version: "8.4"
extension: "pdo_mysql"
custom-entrypoint: >-
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: "Continuous Integration (Nightly)"

on:
schedule:
- cron: "12 3 * * *"

env:
fail-fast: true

jobs:
phpunit-mariadb:
name: "PHPUnit with MariaDB"
runs-on: "ubuntu-24.04"

strategy:
matrix:
php-version:
- "7.4"
- "8.3"
mariadb-version:
- "earliest"
- "verylatest"
extension:
- "mysqli"
- "pdo_mysql"

services:
mariadb:
image: "quay.io/mariadb-foundation/mariadb-devel:${{ matrix.mariadb-version }}"
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
MARIADB_DATABASE: "doctrine_tests"

options: >-
--health-cmd "healthcheck.sh --connect --innodb_initialized"
ports:
- "3306:3306"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"
extensions: "${{ matrix.extension }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml"

- name: Tell the MariaDB Folks if it failed
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@v1
with:
api-key: ${{ secrets.MARIADB_ZULIP_API_KEY }}
email: "doctrine-bot@mariadb.zulipchat.com"
organization-url: "https://mariadb.zulipchat.com"
to: "Buildbot"
type: "stream"
topic: "CI - Doctrine/DBAL"
content: "There was an error running Doctrine on MariaDB:${{ matrix.mariadb-version }} - URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}."
1 change: 1 addition & 0 deletions src/Driver/API/MySQL/ExceptionConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function convert(Exception $exception, ?Query $query): DriverException
return new ConnectionException($exception, $query);

case 2006:
case 4031:
return new ConnectionLost($exception, $query);

case 1048:
Expand Down
3 changes: 2 additions & 1 deletion src/Schema/AbstractAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
* The abstract asset allows to reset the name of all assets without publishing this to the public userland.
*
* This encapsulation hack is necessary to keep a consistent state of the database schema. Say we have a list of tables
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure this does not get
* recreated during schema migration.
*/
abstract class AbstractAsset
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Driver/VersionAwarePlatformDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public static function mySQLVersionProvider(): array
['8', MySQL80Platform::class],
['8.0', MySQL80Platform::class],
['8.0.11', MySQL80Platform::class],
['8.4', MySQL84Platform::class],
['8.4.0', MySQL84Platform::class],
['8.4.1', MySQL84Platform::class],
['9.0.0', MySQL84Platform::class],
['6', MySQL57Platform::class],
['10.0.15-MariaDB-1~wheezy', MySQLPlatform::class],
['5.5.5-10.1.25-MariaDB', MySQLPlatform::class],
Expand Down

0 comments on commit 0f5661e

Please sign in to comment.