Skip to content

Commit daa497f

Browse files
install to PHP extension directory
Signed-off-by: James Xin <[email protected]>
1 parent 7001397 commit daa497f

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

.github/workflows/run-php-tests/action.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,9 @@ runs:
8080
# Debug: Check if extension is loaded and classes exist
8181
echo "=== Extension Debug Info ==="
8282
echo "Extension path: $EXTENSION_PATH"
83+
echo "Loading extension by name: $EXTENSION_PATH"
8384
84-
# Check if this is a file path or extension name
85-
if [[ -f "$EXTENSION_PATH" ]]; then
86-
echo "Loading extension from file: $EXTENSION_PATH"
87-
EXTENSION_ARG="extension=$EXTENSION_PATH"
88-
else
89-
echo "Loading extension by name: $EXTENSION_PATH"
90-
EXTENSION_ARG="extension=$EXTENSION_PATH"
91-
fi
92-
93-
php -n -d "$EXTENSION_ARG" -r "
85+
php -n -d "extension=$EXTENSION_PATH" -r "
9486
echo 'Extension loaded: ' . (extension_loaded('valkey_glide') ? 'YES' : 'NO') . PHP_EOL;
9587
echo 'Extension version: ' . phpversion('valkey_glide') . PHP_EOL;
9688
echo 'Extension functions: ' . PHP_EOL;
@@ -104,16 +96,10 @@ runs:
10496
}
10597
}
10698
echo 'ClientConstructorMock exists: ' . (class_exists('ClientConstructorMock') ? 'YES' : 'NO') . PHP_EOL;
107-
if (class_exists('ClientConstructorMock')) {
108-
echo 'ClientConstructorMock methods: ' . PHP_EOL;
109-
foreach (get_class_methods('ClientConstructorMock') as \$method) {
110-
echo ' - ' . \$method . PHP_EOL;
111-
}
112-
}
11399
"
114100
115101
# Run tests using extension loading
116-
php -n -d "$EXTENSION_ARG" tests/TestValkeyGlide.php
102+
php -n -d "extension=$EXTENSION_PATH" tests/TestValkeyGlide.php
117103
118104
- name: Run integration tests
119105
shell: bash

.github/workflows/test-pie.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ jobs:
244244
fi
245245
fi
246246
247+
# If extension was built but not installed, install it manually
248+
PIE_SO=$(find "$HOME/.config/pie" -name "valkey_glide.so" -type f 2>/dev/null | head -1)
249+
if [ -n "$PIE_SO" ] && [ ! -f "$(php-config --extension-dir)/valkey_glide.so" ]; then
250+
echo "Installing extension from: $PIE_SO"
251+
sudo cp "$PIE_SO" "$(php-config --extension-dir)/valkey_glide.so"
252+
echo "Extension installed to: $(php-config --extension-dir)/valkey_glide.so"
253+
fi
254+
247255
echo "=== Looking for built extension in PIE working directory ==="
248256
PIE_WORK_DIR=$(find "$HOME/.config/pie" -name "valkey-glide-php" -type d | head -1)
249257
if [ -n "$PIE_WORK_DIR" ]; then

0 commit comments

Comments
 (0)