Skip to content

Commit 1cb883b

Browse files
committed
Add GitHub Actions CI
1 parent c072561 commit 1cb883b

File tree

4 files changed

+64
-33
lines changed

4 files changed

+64
-33
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- name: Install system dependencies
8686
run: |
8787
sudo apt-get update
88-
sudo apt-get install -y clang
88+
sudo apt-get install -y clang llvm
8989
9090
- name: Cache cargo registry
9191
uses: actions/cache@v4
@@ -98,15 +98,18 @@ jobs:
9898
restore-keys: |
9999
${{ runner.os }}-php${{ matrix.php }}-cargo-build-
100100
101-
- name: Install cargo-php
102-
run: cargo install cargo-php --locked
103-
104101
- name: Build PHP extension
105102
working-directory: php-sqlx-cdylib
106-
run: cargo php install --release --yes
103+
run: cargo build --release
104+
105+
- name: Install PHP extension
106+
run: |
107+
EXT_DIR=$(php -r "echo ini_get('extension_dir');")
108+
sudo cp target/release/libphp_sqlx_cdylib.so "$EXT_DIR/sqlx.so"
109+
echo "extension=sqlx.so" | sudo tee /etc/php/${{ matrix.php }}/cli/conf.d/99-sqlx.ini
107110
108111
- name: Verify extension loads
109-
run: php -m | grep -i sqlx || echo "Extension registered"
112+
run: php -m | grep -i sqlx
110113

111114
integration-postgres:
112115
name: Integration Tests (PostgreSQL)
@@ -140,7 +143,7 @@ jobs:
140143
- name: Install system dependencies
141144
run: |
142145
sudo apt-get update
143-
sudo apt-get install -y clang
146+
sudo apt-get install -y clang llvm
144147
145148
- name: Cache cargo registry
146149
uses: actions/cache@v4
@@ -153,12 +156,15 @@ jobs:
153156
restore-keys: |
154157
${{ runner.os }}-cargo-integration-
155158
156-
- name: Install cargo-php
157-
run: cargo install cargo-php --locked
158-
159159
- name: Build PHP extension
160160
working-directory: php-sqlx-cdylib
161-
run: cargo php install --release --yes
161+
run: cargo build --release
162+
163+
- name: Install PHP extension
164+
run: |
165+
EXT_DIR=$(php -r "echo ini_get('extension_dir');")
166+
sudo cp target/release/libphp_sqlx_cdylib.so "$EXT_DIR/sqlx.so"
167+
echo "extension=sqlx.so" | sudo tee /etc/php/8.4/cli/conf.d/99-sqlx.ini
162168
163169
- name: Run integration tests
164170
env:
@@ -206,7 +212,7 @@ jobs:
206212
- name: Install system dependencies
207213
run: |
208214
sudo apt-get update
209-
sudo apt-get install -y clang
215+
sudo apt-get install -y clang llvm
210216
211217
- name: Cache cargo registry
212218
uses: actions/cache@v4
@@ -219,12 +225,15 @@ jobs:
219225
restore-keys: |
220226
${{ runner.os }}-cargo-mysql-
221227
222-
- name: Install cargo-php
223-
run: cargo install cargo-php --locked
224-
225228
- name: Build PHP extension
226229
working-directory: php-sqlx-cdylib
227-
run: cargo php install --release --yes
230+
run: cargo build --release
231+
232+
- name: Install PHP extension
233+
run: |
234+
EXT_DIR=$(php -r "echo ini_get('extension_dir');")
235+
sudo cp target/release/libphp_sqlx_cdylib.so "$EXT_DIR/sqlx.so"
236+
echo "extension=sqlx.so" | sudo tee /etc/php/8.4/cli/conf.d/99-sqlx.ini
228237
229238
- name: Run integration tests
230239
env:

Cargo.lock

Lines changed: 19 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ itertools = "0.14"
1111
mimalloc = { version = "0.1", optional = true }
1212
parse_duration = "2.1.1"
1313
serde_json = "1.0"
14-
simd-json = { optional = true, version = "0.16" }
14+
simd-json = { optional = true, version = "0.17.0" }
1515
#sqlx-oldapi = { path = "sqlx-oldapi", features = ["json", "runtime-tokio-rustls"] }`
1616
sqlx-oldapi = { git = "https://github.com/sqlpage/sqlx-oldapi", branch = "main", features = ["json", "runtime-tokio-rustls"] }
1717
threadsafe-lru = "0.1"

php-sqlx-cdylib/Cargo.lock

Lines changed: 19 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)