Skip to content

Commit e3ebbdc

Browse files
CI: Fix test-pie CI on mac (#43)
Signed-off-by: James Xin <[email protected]>
1 parent a903be9 commit e3ebbdc

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

.github/json_matrices/build-matrix.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"TARGET": "x86_64-unknown-linux-gnu",
88
"PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"],
99
"run": "always",
10-
"languages": ["python", "node", "java", "go", "dotnet", "rust"]
10+
"languages": ["python", "node", "java", "go", "dotnet", "rust", "php"]
1111
},
1212
{
1313
"OS": "ubuntu",
@@ -17,7 +17,7 @@
1717
"ARCH": "arm64",
1818
"TARGET": "aarch64-unknown-linux-gnu",
1919
"PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"],
20-
"languages": ["python", "node", "java", "go", "dotnet"]
20+
"languages": ["python", "node", "java", "go", "dotnet", "php"]
2121
},
2222
{
2323
"OS": "macos",
@@ -26,7 +26,7 @@
2626
"ARCH": "arm64",
2727
"TARGET": "aarch64-apple-darwin",
2828
"PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"],
29-
"languages": ["python", "node", "java", "go", "dotnet"]
29+
"languages": ["python", "node", "java", "go", "dotnet", "php"]
3030
},
3131
{
3232
"OS": "macos",

.github/workflows/test-pie.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ permissions:
66
on:
77
push: {}
88
pull_request: {}
9+
workflow_dispatch:
10+
inputs:
11+
full-matrix:
12+
description: "Run the full engine, host, and language version matrix"
13+
type: boolean
14+
default: false
915

1016
jobs:
1117
get-matrices:
@@ -25,7 +31,7 @@ jobs:
2531
# Run full test matrix if job started by cron or it was explicitly specified by a person who triggered the workflow
2632
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
2733

28-
test-php:
34+
test-pie-install:
2935
name: PHP Tests - ${{ matrix.php }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}
3036
needs: get-matrices
3137
timeout-minutes: 35
@@ -47,27 +53,10 @@ jobs:
4753
echo "Job running with the following matrix configuration:"
4854
echo "${{ toJson(matrix) }}"
4955
50-
test-pie-install:
51-
name: PHP Tests - ${{ matrix.php }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}
52-
needs: get-matrices
53-
timeout-minutes: 35
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
php: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }}
58-
engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }}
59-
host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }}
60-
runs-on: ${{ matrix.host.RUNNER }}
61-
62-
steps:
63-
- uses: actions/checkout@v4
64-
with:
65-
submodules: recursive
66-
6756
- name: Setup PHP Extension Build Environment
6857
uses: ./.github/workflows/setup-php-extension
6958
with:
70-
php-version: ${{ env.BASE_PHP_VERSION }}
59+
php-version: ${{ matrix.php }}
7160
install-composer-deps: "true"
7261

7362
- name: Create manual Composer repository
@@ -122,7 +111,11 @@ jobs:
122111
123112
# Make sure root can read the user's composer config
124113
sudo chmod -R 755 "$HOME/.config/composer"
125-
sudo chown -R root:root "$HOME/.config/composer" || true
114+
if [[ "${{ matrix.host.OS }}" == "macos" ]]; then
115+
sudo chown -R root:wheel "$HOME/.config/composer" || true
116+
else
117+
sudo chown -R root:root "$HOME/.config/composer" || true
118+
fi
126119
127120
# Add local repository
128121
pie repository:add composer http://localhost:8000
@@ -160,7 +153,7 @@ jobs:
160153
if [ -n "$SO_FILE" ]; then
161154
echo "SUCCESS: Shared object built at: $SO_FILE"
162155
ls -la "$SO_FILE"
163-
echo "File size: $(stat -c%s "$SO_FILE" 2>/dev/null || echo "unknown") bytes"
156+
echo "File size: $(if [[ "${{ matrix.host.OS }}" == "macos" ]]; then stat -f%z "$SO_FILE" 2>/dev/null; else stat -c%s "$SO_FILE" 2>/dev/null; fi || echo "unknown") bytes"
164157
else
165158
echo "WARNING: PIE reported success but valkey_glide.so not found"
166159
find "$PIE_WORK_DIR" -name "*.so" -type f 2>/dev/null || echo "No .so files found at all"
@@ -237,8 +230,13 @@ jobs:
237230
php --ini
238231
239232
echo "=== Looking for PIE-generated ini files ==="
240-
find /etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files found"
241-
find /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files in /usr/local"
233+
if [[ "${{ matrix.host.OS }}" == "macos" ]]; then
234+
find /opt/homebrew/etc/php* /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files found"
235+
find /opt/homebrew/etc/php* /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files in /usr/local"
236+
else
237+
find /etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files found"
238+
find /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files in /usr/local"
239+
fi
242240
243241
echo "=== Manually enabling extension ==="
244242
php -d extension=valkey_glide -m | grep -i valkey && echo "Extension works when manually enabled!" || echo "Extension still not working"
@@ -250,7 +248,7 @@ jobs:
250248
uses: ./.github/workflows/run-php-tests
251249
with:
252250
extension-path: valkey_glide
253-
php-version: ${{ env.BASE_PHP_VERSION }}
251+
php-version: ${{ matrix.php }}
254252

255253
- name: Cleanup
256254
if: always()

0 commit comments

Comments
 (0)