@@ -6,6 +6,12 @@ permissions:
66on :
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
1016jobs :
1117 get-matrices :
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,33 +53,27 @@ 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
7463 run : |
7564 mkdir -p web
7665
66+ # Determine the correct repository URL and reference for PRs vs direct pushes
67+ if [ "${{ github.event_name }}" = "pull_request" ]; then
68+ REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}"
69+ REPO_REF="${{ github.event.pull_request.head.sha }}"
70+ echo "Using PR head repository: $REPO_URL at $REPO_REF"
71+ else
72+ REPO_URL="${{ github.server_url }}/${{ github.repository }}"
73+ REPO_REF="${{ github.sha }}"
74+ echo "Using main repository: $REPO_URL at $REPO_REF"
75+ fi
76+
7777 # Create packages.json manually
7878 cat > web/packages.json << EOF
7979 {
8585 "version_normalized": "1.0.0.0",
8686 "source": {
8787 "type": "git",
88- "url": "${{ github.event.pull_request.head.repo.clone_url || format('{0}/{1}', github.server_url, github.repository) }} ",
89- "reference": "${{ github.head_ref || github.ref_name }} "
88+ "url": "$REPO_URL ",
89+ "reference": "$REPO_REF "
9090 },
9191 "type": "php-ext",
9292 "php-ext": {
@@ -122,7 +122,11 @@ jobs:
122122
123123 # Make sure root can read the user's composer config
124124 sudo chmod -R 755 "$HOME/.config/composer"
125- sudo chown -R root:root "$HOME/.config/composer" || true
125+ if [[ "${{ matrix.host.OS }}" == "macos" ]]; then
126+ sudo chown -R root:wheel "$HOME/.config/composer" || true
127+ else
128+ sudo chown -R root:root "$HOME/.config/composer" || true
129+ fi
126130
127131 # Add local repository
128132 pie repository:add composer http://localhost:8000
@@ -160,7 +164,7 @@ jobs:
160164 if [ -n "$SO_FILE" ]; then
161165 echo "SUCCESS: Shared object built at: $SO_FILE"
162166 ls -la "$SO_FILE"
163- echo "File size: $(stat -c%s "$SO_FILE" 2>/dev/null || echo "unknown") bytes"
167+ 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"
164168 else
165169 echo "WARNING: PIE reported success but valkey_glide.so not found"
166170 find "$PIE_WORK_DIR" -name "*.so" -type f 2>/dev/null || echo "No .so files found at all"
@@ -237,8 +241,13 @@ jobs:
237241 php --ini
238242
239243 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"
244+ if [[ "${{ matrix.host.OS }}" == "macos" ]]; then
245+ find /opt/homebrew/etc/php* /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files found"
246+ find /opt/homebrew/etc/php* /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files in /usr/local"
247+ else
248+ find /etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files found"
249+ find /usr/local/etc/php* -name "*valkey*" 2>/dev/null || echo "No valkey ini files in /usr/local"
250+ fi
242251
243252 echo "=== Manually enabling extension ==="
244253 php -d extension=valkey_glide -m | grep -i valkey && echo "Extension works when manually enabled!" || echo "Extension still not working"
@@ -250,7 +259,7 @@ jobs:
250259 uses : ./.github/workflows/run-php-tests
251260 with :
252261 extension-path : valkey_glide
253- php-version : ${{ env.BASE_PHP_VERSION }}
262+ php-version : ${{ matrix.php }}
254263
255264 - name : Cleanup
256265 if : always()
0 commit comments