From 8a2500c63c2fe124003863c401353ff2355a8026 Mon Sep 17 00:00:00 2001 From: Niels Drost <47660417+nielsdrost7@users.noreply.github.com> Date: Thu, 4 Jun 2026 16:36:48 +0200 Subject: [PATCH 1/3] ci: switch test workflows to MariaDB --- .env.testing.example | 8 +++- .github/RUNNING_TESTS.md | 2 +- .github/actions/setup-php-composer/action.yml | 2 +- .github/workflows/composer-update.yml | 25 +++++++++++- .github/workflows/phpunit.yml | 36 ++++++++++------- .github/workflows/quickstart.yml | 39 ++++++++++--------- .github/workflows/setup.yml | 11 +++--- .github/workflows/smoke.yml | 23 ++++++++++- .github/workflows/yarn-update.yml | 2 +- phpunit.smoke.xml | 8 +++- phpunit.xml | 8 +++- 11 files changed, 115 insertions(+), 49 deletions(-) diff --git a/.env.testing.example b/.env.testing.example index a02e670d4..7250fd3c4 100644 --- a/.env.testing.example +++ b/.env.testing.example @@ -21,8 +21,12 @@ LOG_DAILY_DAYS=7 LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=sqlite -DB_DATABASE=:memory: +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=testing +DB_USERNAME=root +DB_PASSWORD=root SESSION_DRIVER=array SESSION_LIFETIME=120 diff --git a/.github/RUNNING_TESTS.md b/.github/RUNNING_TESTS.md index b053e2ca1..d50baa501 100644 --- a/.github/RUNNING_TESTS.md +++ b/.github/RUNNING_TESTS.md @@ -170,7 +170,7 @@ InvoicePlane v2 uses two PHPUnit configuration files: ### phpunit.xml - Runs all Unit and Feature test suites -- Uses SQLite in-memory database +- Uses MariaDB/MySQL via the testing database settings in `.env.testing.example` - Includes all test directories ### phpunit.smoke.xml diff --git a/.github/actions/setup-php-composer/action.yml b/.github/actions/setup-php-composer/action.yml index a4270eb5c..56aefd315 100644 --- a/.github/actions/setup-php-composer/action.yml +++ b/.github/actions/setup-php-composer/action.yml @@ -8,7 +8,7 @@ inputs: php-extensions: description: 'PHP extensions to install (comma-separated)' required: false - default: 'mbstring, xml, ctype, json, fileinfo, pdo, sqlite, mysql, bcmath' + default: 'mbstring, xml, ctype, json, fileinfo, pdo, pdo_mysql, bcmath' composer-flags: description: 'Flags appended to the composer install command (e.g., --no-dev --optimize-autoloader). Used only when composer-args is empty.' required: false diff --git a/.github/workflows/composer-update.yml b/.github/workflows/composer-update.yml index ee73c8707..d74e0840c 100644 --- a/.github/workflows/composer-update.yml +++ b/.github/workflows/composer-update.yml @@ -36,6 +36,29 @@ jobs: update-composer-dependencies: runs-on: ubuntu-latest + services: + mysql: + image: mariadb:11 + env: + MARIADB_ROOT_PASSWORD: root + MARIADB_ROOT_HOST: '%' + MARIADB_DATABASE: testing + ports: + - 3306:3306 + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + + env: + DB_CONNECTION: mysql + DB_HOST: 127.0.0.1 + DB_PORT: 3306 + DB_DATABASE: testing + DB_USERNAME: root + DB_PASSWORD: root + steps: - name: Checkout code uses: actions/checkout@v4 @@ -46,7 +69,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.4' - extensions: mbstring, xml, ctype, json, fileinfo, pdo, sqlite, mysql, bcmath + extensions: mbstring, xml, ctype, json, fileinfo, pdo, pdo_mysql, bcmath coverage: none - name: Repair Composer install diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 2af549fff..79aaaf430 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -10,20 +10,28 @@ jobs: phpunit: runs-on: ubuntu-latest - # MySQL service commented out - tests use SQLite in-memory instead - # services: - # mysql: - # image: mysql:8 - # env: - # MYSQL_ROOT_PASSWORD: root - # MYSQL_DATABASE: testing - # ports: - # - 3306:3306 - # options: >- - # --health-cmd="mysqladmin ping --silent" - # --health-interval=10s - # --health-timeout=5s - # --health-retries=3 + services: + mysql: + image: mariadb:11 + env: + MARIADB_ROOT_PASSWORD: root + MARIADB_ROOT_HOST: '%' + MARIADB_DATABASE: testing + ports: + - 3306:3306 + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + + env: + DB_CONNECTION: mysql + DB_HOST: 127.0.0.1 + DB_PORT: 3306 + DB_DATABASE: testing + DB_USERNAME: root + DB_PASSWORD: root steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/quickstart.yml b/.github/workflows/quickstart.yml index f12109b54..6a84f9532 100644 --- a/.github/workflows/quickstart.yml +++ b/.github/workflows/quickstart.yml @@ -10,28 +10,29 @@ jobs: permissions: contents: read - # MySQL service commented out - smoke tests should not require database setup - # services: - # mysql: - # image: mariadb:10.6 - # env: - # MYSQL_DATABASE: testing - # MYSQL_ROOT_PASSWORD: root - # ports: - # - 3306:3306 - # options: >- - # --health-cmd="mysqladmin ping" - # --health-interval=10s - # --health-timeout=5s - # --health-retries=5 + services: + mysql: + image: mariadb:11 + env: + MARIADB_DATABASE: testing + MARIADB_ROOT_PASSWORD: root + MARIADB_ROOT_HOST: '%' + ports: + - 3306:3306 + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" + --health-interval=10s + --health-timeout=5s + --health-retries=5 env: - # DB_CONNECTION: mysql - # DB_DATABASE: testing - # DB_USERNAME: root - # DB_PASSWORD: root - # DB_HOST: 127.0.0.1 APP_ENV: testing + DB_CONNECTION: mysql + DB_HOST: 127.0.0.1 + DB_PORT: 3306 + DB_DATABASE: testing + DB_USERNAME: root + DB_PASSWORD: root steps: - name: Checkout repository diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 6287e4d9d..089f6b4e7 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -62,14 +62,15 @@ jobs: services: mysql: - image: mariadb:10.6 + image: mariadb:11 env: - MYSQL_DATABASE: ivplv2 - MYSQL_ROOT_PASSWORD: root + MARIADB_DATABASE: ivplv2 + MARIADB_ROOT_PASSWORD: root + MARIADB_ROOT_HOST: '%' ports: - 3306:3306 options: >- - --health-cmd="mysqladmin ping" + --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=5 @@ -90,7 +91,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.4' - extensions: mbstring, xml, json, pdo, mysql + extensions: mbstring, xml, json, pdo, pdo_mysql coverage: none - name: Set up Node.js diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index ae4405b0c..be5fdc59c 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -11,8 +11,29 @@ jobs: name: Composer, migrations, and smoke tests runs-on: ubuntu-latest + services: + mysql: + image: mariadb:11 + env: + MARIADB_ROOT_PASSWORD: root + MARIADB_ROOT_HOST: '%' + MARIADB_DATABASE: testing + ports: + - 3306:3306 + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + env: APP_ENV: testing + DB_CONNECTION: mysql + DB_HOST: 127.0.0.1 + DB_PORT: 3306 + DB_DATABASE: testing + DB_USERNAME: root + DB_PASSWORD: root steps: - name: Checkout repository @@ -22,7 +43,7 @@ jobs: uses: ./.github/actions/setup-php-composer with: php-version: '8.4' - php-extensions: 'mbstring, xml, ctype, json, fileinfo, pdo, sqlite, mysql, bcmath' + php-extensions: 'mbstring, xml, ctype, json, fileinfo, pdo, pdo_mysql, bcmath' composer-flags: '--prefer-dist --no-interaction' - name: Prepare Laravel environment diff --git a/.github/workflows/yarn-update.yml b/.github/workflows/yarn-update.yml index 6e590adea..5257da2a2 100644 --- a/.github/workflows/yarn-update.yml +++ b/.github/workflows/yarn-update.yml @@ -52,7 +52,7 @@ jobs: uses: ./.github/actions/setup-php-composer with: php-version: '8.2' - php-extensions: 'mbstring, xml, ctype, json, fileinfo, pdo, sqlite, mysql' + php-extensions: 'mbstring, xml, ctype, json, fileinfo, pdo, pdo_mysql' - name: Check for package-lock.json conflicts id: lockfile-check diff --git a/phpunit.smoke.xml b/phpunit.smoke.xml index c2788bb95..a794f2dce 100644 --- a/phpunit.smoke.xml +++ b/phpunit.smoke.xml @@ -29,8 +29,12 @@ - - + + + + + + diff --git a/phpunit.xml b/phpunit.xml index c52013c61..fdc7bcec2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -26,8 +26,12 @@ - - + + + + + + From 20f9c41dc4a8fb60df9b29236c1cdb89b4a83042 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Jun 2026 03:20:46 +0000 Subject: [PATCH 2/3] ci: downgrade MariaDB image to mariadb:10.11 --- .github/workflows/phpunit.yml | 2 +- .github/workflows/quickstart.yml | 2 +- .github/workflows/smoke.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index ce2ecc1dd..40868fef4 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,7 +12,7 @@ jobs: services: mariadb: - image: mariadb:11 + image: mariadb:10.11 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: invoiceplane_test diff --git a/.github/workflows/quickstart.yml b/.github/workflows/quickstart.yml index 875574c44..dbac2d03d 100644 --- a/.github/workflows/quickstart.yml +++ b/.github/workflows/quickstart.yml @@ -12,7 +12,7 @@ jobs: services: mariadb: - image: mariadb:11 + image: mariadb:10.11 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: invoiceplane_test diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 4c5049667..44562920d 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -21,7 +21,7 @@ jobs: services: mariadb: - image: mariadb:11 + image: mariadb:10.11 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: invoiceplane_test From b4d4b11a87ca4ba14a1ff7d087183e3ef74d6d58 Mon Sep 17 00:00:00 2001 From: Niels Drost <47660417+nielsdrost7@users.noreply.github.com> Date: Sat, 6 Jun 2026 05:21:26 +0200 Subject: [PATCH 3/3] Update .github/RUNNING_TESTS.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/RUNNING_TESTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/RUNNING_TESTS.md b/.github/RUNNING_TESTS.md index d50baa501..1534b0660 100644 --- a/.github/RUNNING_TESTS.md +++ b/.github/RUNNING_TESTS.md @@ -170,7 +170,7 @@ InvoicePlane v2 uses two PHPUnit configuration files: ### phpunit.xml - Runs all Unit and Feature test suites -- Uses MariaDB/MySQL via the testing database settings in `.env.testing.example` +- Uses MariaDB/MySQL via `DB_*` values in `phpunit.xml` / `phpunit.smoke.xml` (overridable by process environment variables) - Includes all test directories ### phpunit.smoke.xml