Skip to content

Commit e6d5b2c

Browse files
committed
Run native parser extension suite across PHP versions
1 parent b186e84 commit e6d5b2c

1 file changed

Lines changed: 10 additions & 53 deletions

File tree

.github/workflows/mysql-parser-extension-tests.yml

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: MySQL Parser Extension Tests
22

33
on:
44
push:
5+
branches:
6+
- trunk
57
paths:
68
- '.github/workflows/mysql-parser-extension-tests.yml'
79
- 'packages/mysql-on-sqlite/**'
@@ -19,9 +21,13 @@ concurrency:
1921

2022
jobs:
2123
extension-tests:
22-
name: PHP 8.2 / Rust extension / ubuntu-latest
24+
name: PHP ${{ matrix.php }} / Rust extension / ubuntu-latest
2325
runs-on: ubuntu-latest
2426
timeout-minutes: 20
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
2531

2632
steps:
2733
- name: Checkout repository
@@ -30,7 +36,7 @@ jobs:
3036
- name: Set up PHP
3137
uses: shivammathur/setup-php@v2
3238
with:
33-
php-version: '8.2'
39+
php-version: ${{ matrix.php }}
3440
coverage: none
3541
tools: phpunit-polyfills
3642

@@ -59,6 +65,7 @@ jobs:
5965
composer-options: "--optimize-autoloader"
6066

6167
- name: Check Rust formatting
68+
if: matrix.php == '8.2'
6269
run: cargo fmt --check
6370
working-directory: packages/php-ext-wp-mysql-parser
6471

@@ -98,56 +105,6 @@ jobs:
98105
'
99106
working-directory: packages/mysql-on-sqlite
100107

101-
- name: Run full PHPUnit suite with parser extension
102-
env:
103-
WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION: '1'
104-
run: php -d extension="$GITHUB_WORKSPACE/packages/php-ext-wp-mysql-parser/target/debug/libwp_mysql_parser.so" ./vendor/bin/phpunit -c ./phpunit.xml.dist
105-
working-directory: packages/mysql-on-sqlite
106-
107-
sqlite-driver-extension-tests:
108-
name: PHP 8.2 / SQLite driver / Rust extension / ubuntu-latest
109-
runs-on: ubuntu-latest
110-
timeout-minutes: 20
111-
112-
steps:
113-
- name: Checkout repository
114-
uses: actions/checkout@v4
115-
116-
- name: Set up PHP
117-
uses: shivammathur/setup-php@v2
118-
with:
119-
php-version: '8.2'
120-
coverage: none
121-
tools: phpunit-polyfills
122-
123-
- name: Set up Rust
124-
uses: dtolnay/rust-toolchain@stable
125-
126-
- name: Install native build dependencies
127-
run: |
128-
sudo apt-get update
129-
sudo apt-get install -y libclang-dev
130-
echo "PHP_CONFIG=$(command -v php-config)" >> "$GITHUB_ENV"
131-
LIBCLANG_SO="$(find /usr/lib -name 'libclang.so*' | head -n 1)"
132-
echo "LIBCLANG_PATH=$(dirname "$LIBCLANG_SO")" >> "$GITHUB_ENV"
133-
134-
- name: Install Composer dependencies (root)
135-
uses: ramsey/composer-install@v3
136-
with:
137-
ignore-cache: "yes"
138-
composer-options: "--optimize-autoloader"
139-
140-
- name: Install Composer dependencies (mysql-on-sqlite)
141-
uses: ramsey/composer-install@v3
142-
with:
143-
working-directory: packages/mysql-on-sqlite
144-
ignore-cache: "yes"
145-
composer-options: "--optimize-autoloader"
146-
147-
- name: Build parser extension
148-
run: cargo build
149-
working-directory: packages/php-ext-wp-mysql-parser
150-
151108
- name: Verify SQLite driver selects the native parser path
152109
run: |
153110
php -d extension="$GITHUB_WORKSPACE/packages/php-ext-wp-mysql-parser/target/debug/libwp_mysql_parser.so" -r '
@@ -199,7 +156,7 @@ jobs:
199156
}
200157
'
201158
202-
- name: Run full PHPUnit suite with SQLite driver using parser extension
159+
- name: Run full PHPUnit suite with parser extension
203160
env:
204161
WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION: '1'
205162
run: php -d extension="$GITHUB_WORKSPACE/packages/php-ext-wp-mysql-parser/target/debug/libwp_mysql_parser.so" ./vendor/bin/phpunit -c ./phpunit.xml.dist

0 commit comments

Comments
 (0)