Skip to content

Commit 668db85

Browse files
committed
Add Rust MySQL parser extension
1 parent 47c2c03 commit 668db85

10 files changed

Lines changed: 8524 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: MySQL Parser Extension Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/workflows/mysql-parser-extension-tests.yml'
7+
- 'packages/mysql-on-sqlite/**'
8+
pull_request:
9+
paths:
10+
- '.github/workflows/mysql-parser-extension-tests.yml'
11+
- 'packages/mysql-on-sqlite/**'
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
extension-tests:
20+
name: PHP 8.2 / Rust extension / ubuntu-latest
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 20
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: '8.2'
32+
coverage: none
33+
tools: phpunit-polyfills
34+
35+
- name: Set up Rust
36+
uses: dtolnay/rust-toolchain@stable
37+
38+
- name: Install native build dependencies
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install -y libclang-dev
42+
echo "PHP_CONFIG=$(command -v php-config)" >> "$GITHUB_ENV"
43+
LIBCLANG_SO="$(find /usr/lib -name 'libclang.so*' | head -n 1)"
44+
echo "LIBCLANG_PATH=$(dirname "$LIBCLANG_SO")" >> "$GITHUB_ENV"
45+
46+
- name: Install Composer dependencies (root)
47+
uses: ramsey/composer-install@v3
48+
with:
49+
ignore-cache: "yes"
50+
composer-options: "--optimize-autoloader"
51+
52+
- name: Install Composer dependencies (mysql-on-sqlite)
53+
uses: ramsey/composer-install@v3
54+
with:
55+
working-directory: packages/mysql-on-sqlite
56+
ignore-cache: "yes"
57+
composer-options: "--optimize-autoloader"
58+
59+
- name: Check Rust formatting
60+
run: cargo fmt --check
61+
working-directory: packages/mysql-on-sqlite/ext/wp-mysql-parser
62+
63+
- name: Build parser extension
64+
run: cargo build
65+
working-directory: packages/mysql-on-sqlite/ext/wp-mysql-parser
66+
67+
- name: Run PHPUnit tests with parser extension
68+
run: php -d extension="$GITHUB_WORKSPACE/packages/mysql-on-sqlite/ext/wp-mysql-parser/target/debug/libwp_mysql_parser.so" ./vendor/bin/phpunit -c ./phpunit.xml.dist
69+
working-directory: packages/mysql-on-sqlite

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ composer.lock
88
/build
99
/wordpress
1010
/.claude/settings.local.json
11+
/.adversarial-loop/
12+
/packages/mysql-on-sqlite/ext/wp-mysql-parser/target/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

0 commit comments

Comments
 (0)