Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/lexer-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
php-version: '8.4'
coverage: none

- name: Install Composer dependencies (mysql-on-sqlite)
uses: ramsey/composer-install@v3
with:
working-directory: packages/mysql-on-sqlite
composer-options: "--optimize-autoloader"

- name: Benchmark base vs PR
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/mysql-proxy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ jobs:
composer-options: "--optimize-autoloader"
working-directory: packages/mysql-proxy

# The proxy tests run the SQLite driver, which loads its own Composer
# dependencies (wordpress/mysql-parser).
- name: Install Composer dependencies (mysql-on-sqlite)
uses: ramsey/composer-install@v3
with:
ignore-cache: "yes"
composer-options: "--optimize-autoloader"
working-directory: packages/mysql-on-sqlite

- name: Run MySQL Proxy tests
run: composer run test
working-directory: packages/mysql-proxy
84 changes: 14 additions & 70 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- '.github/workflows/phpunit-tests.yml'
- 'packages/mysql-on-sqlite/**'
- 'packages/php-ext-wp-mysql-parser/**'
- 'packages/mysql-parser/**'
- 'composer.json'
- 'composer.lock'
pull_request:
paths:
- '.github/workflows/phpunit-tests.yml'
- 'packages/mysql-on-sqlite/**'
- 'packages/php-ext-wp-mysql-parser/**'
- 'packages/mysql-parser/**'
- 'composer.json'
- 'composer.lock'
workflow_dispatch:
Expand All @@ -29,10 +29,7 @@ permissions: {}

jobs:
test:
# The pure-PHP parser is exercised across the full PHP/SQLite range; the
# native Rust parser extension is exercised on PHP 8.0+ (its minimum). Both
# run the same mysql-on-sqlite suite, just with a different parser engine.
name: PHP ${{ matrix.php }}${{ matrix.extension && ' + ext-wp-mysql-parser' || '' }} / SQLite ${{ matrix.sqlite }}
name: PHP ${{ matrix.php }} / SQLite ${{ matrix.sqlite }}
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
Expand All @@ -41,24 +38,17 @@ jobs:
fail-fast: false
matrix:
include:
# Pure-PHP parser, across the supported PHP versions, each pinned to a
# representative SQLite version spanning the supported range.
- { php: '7.2', sqlite: '3.27.0', extension: false } # minimum with WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS
- { php: '7.3', sqlite: '3.31.1', extension: false } # Ubuntu 20.04 LTS
- { php: '7.4', sqlite: '3.34.1', extension: false } # Debian 11 (Bullseye)
- { php: '8.0', sqlite: '3.37.0', extension: false } # minimum supported version (STRICT tables)
- { php: '8.1', sqlite: '3.40.1', extension: false } # Debian 12 (Bookworm)
- { php: '8.2', sqlite: '3.45.1', extension: false } # Ubuntu 24.04 LTS
- { php: '8.3', sqlite: '3.46.1', extension: false } # Debian 13 (Trixie)
- { php: '8.4', sqlite: '3.51.2', extension: false } # First 2026 release
- { php: '8.5', sqlite: 'latest', extension: false }
# Native Rust parser extension (requires PHP 8.0+).
- { php: '8.0', sqlite: '3.37.0', extension: true }
- { php: '8.1', sqlite: '3.40.1', extension: true }
- { php: '8.2', sqlite: '3.45.1', extension: true }
- { php: '8.3', sqlite: '3.46.1', extension: true }
- { php: '8.4', sqlite: '3.51.2', extension: true }
- { php: '8.5', sqlite: 'latest', extension: true }
# All supported PHP versions, each pinned to a representative SQLite
# version spanning the supported range.
- { php: '7.2', sqlite: '3.27.0' } # minimum with WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS
- { php: '7.3', sqlite: '3.31.1' } # Ubuntu 20.04 LTS
- { php: '7.4', sqlite: '3.34.1' } # Debian 11 (Bullseye)
- { php: '8.0', sqlite: '3.37.0' } # minimum supported version (STRICT tables)
- { php: '8.1', sqlite: '3.40.1' } # Debian 12 (Bookworm)
- { php: '8.2', sqlite: '3.45.1' } # Ubuntu 24.04 LTS
- { php: '8.3', sqlite: '3.46.1' } # Debian 13 (Trixie)
- { php: '8.4', sqlite: '3.51.2' } # First 2026 release
- { php: '8.5', sqlite: 'latest' }

steps:
- name: Checkout repository
Expand Down Expand Up @@ -124,29 +114,6 @@ jobs:
exit 1
fi

- name: Set up Rust
if: matrix.extension
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust build
if: matrix.extension
uses: Swatinem/rust-cache@v2
with:
workspaces: packages/php-ext-wp-mysql-parser
# Segregate by PHP version: the extension links against the PHP headers
# of the matrix's php-config, so a build cached for one PHP version is
# ABI-incompatible with another (Zend module API mismatch on load).
key: php-${{ matrix.php }}

- name: Install native build dependencies
if: matrix.extension
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev
echo "PHP_CONFIG=$(command -v php-config)" >> "$GITHUB_ENV"
LIBCLANG_SO="$(find /usr/lib -name 'libclang.so*' | head -n 1)"
echo "LIBCLANG_PATH=$(dirname "$LIBCLANG_SO")" >> "$GITHUB_ENV"

- name: Install Composer dependencies (root)
uses: ramsey/composer-install@v3
with:
Expand All @@ -160,29 +127,6 @@ jobs:
ignore-cache: "yes"
composer-options: "--optimize-autoloader"

- name: Check Rust formatting
if: ${{ matrix.extension && matrix.php == '8.2' }}
run: cargo fmt --check
working-directory: packages/php-ext-wp-mysql-parser

- name: Build parser extension
if: matrix.extension
run: cargo build --release
working-directory: packages/php-ext-wp-mysql-parser

- name: Verify native parser extension
if: matrix.extension
run: php -d extension="$GITHUB_WORKSPACE/packages/php-ext-wp-mysql-parser/target/release/libwp_mysql_parser.so" tests/tools/verify-native-parser-extension.php
working-directory: packages/mysql-on-sqlite

- name: Run PHPUnit suite with parser extension
if: matrix.extension
env:
WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION: '1'
run: php -d extension="$GITHUB_WORKSPACE/packages/php-ext-wp-mysql-parser/target/release/libwp_mysql_parser.so" ./vendor/bin/phpunit -c ./phpunit.xml.dist
working-directory: packages/mysql-on-sqlite

- name: Run PHPUnit suite
if: ${{ ! matrix.extension }}
run: php ./vendor/bin/phpunit -c ./phpunit.xml.dist
working-directory: packages/mysql-on-sqlite
211 changes: 0 additions & 211 deletions .github/workflows/wp-tests-phpunit-native-extension-setup.sh

This file was deleted.

Loading
Loading