Skip to content

Commit 3f33937

Browse files
committed
GitHub Actions CI
1 parent 1cb883b commit 3f33937

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,23 @@ jobs:
105105
- name: Install PHP extension
106106
run: |
107107
EXT_DIR=$(php -r "echo ini_get('extension_dir');")
108+
echo "Extension directory: $EXT_DIR"
108109
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
110+
# Find the correct PHP ini scan directory
111+
INI_DIR=$(php -r "echo PHP_CONFIG_FILE_SCAN_DIR;")
112+
echo "INI scan directory: $INI_DIR"
113+
if [ -n "$INI_DIR" ] && [ -d "$INI_DIR" ]; then
114+
echo "extension=sqlx.so" | sudo tee "$INI_DIR/99-sqlx.ini"
115+
else
116+
# Fallback: add to main php.ini
117+
PHP_INI=$(php -r "echo php_ini_loaded_file();")
118+
echo "extension=sqlx.so" | sudo tee -a "$PHP_INI"
119+
fi
110120
111121
- name: Verify extension loads
112-
run: php -m | grep -i sqlx
122+
run: |
123+
php -m
124+
php -m | grep -i sqlx
113125
114126
integration-postgres:
115127
name: Integration Tests (PostgreSQL)
@@ -163,8 +175,17 @@ jobs:
163175
- name: Install PHP extension
164176
run: |
165177
EXT_DIR=$(php -r "echo ini_get('extension_dir');")
178+
echo "Extension directory: $EXT_DIR"
166179
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
180+
INI_DIR=$(php -r "echo PHP_CONFIG_FILE_SCAN_DIR;")
181+
echo "INI scan directory: $INI_DIR"
182+
if [ -n "$INI_DIR" ] && [ -d "$INI_DIR" ]; then
183+
echo "extension=sqlx.so" | sudo tee "$INI_DIR/99-sqlx.ini"
184+
else
185+
PHP_INI=$(php -r "echo php_ini_loaded_file();")
186+
echo "extension=sqlx.so" | sudo tee -a "$PHP_INI"
187+
fi
188+
php -m | grep -i sqlx
168189
169190
- name: Run integration tests
170191
env:
@@ -232,8 +253,17 @@ jobs:
232253
- name: Install PHP extension
233254
run: |
234255
EXT_DIR=$(php -r "echo ini_get('extension_dir');")
256+
echo "Extension directory: $EXT_DIR"
235257
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
258+
INI_DIR=$(php -r "echo PHP_CONFIG_FILE_SCAN_DIR;")
259+
echo "INI scan directory: $INI_DIR"
260+
if [ -n "$INI_DIR" ] && [ -d "$INI_DIR" ]; then
261+
echo "extension=sqlx.so" | sudo tee "$INI_DIR/99-sqlx.ini"
262+
else
263+
PHP_INI=$(php -r "echo php_ini_loaded_file();")
264+
echo "extension=sqlx.so" | sudo tee -a "$PHP_INI"
265+
fi
266+
php -m | grep -i sqlx
237267
238268
- name: Run integration tests
239269
env:

0 commit comments

Comments
 (0)