Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/json_matrices/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"ARCH": "arm64",
"TARGET": "aarch64-apple-darwin",
"PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"],
"comment": "Making mac always run for in-PR testing, to be removed",
"run": "always",
"languages": ["python", "node", "java", "go", "dotnet", "php"]
},
{
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/install-zig/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ runs:
- name: Install zig
shell: bash
run: |
if [[ `cat /etc/os-release | grep "Amazon Linux"` ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS detected, pip3 already available"
elif [[ `cat /etc/os-release | grep "Amazon Linux"` ]]; then
yum install -y python3-pip
else
sudo apt install -y python3-pip
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ jobs:
- name: Install shared dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
target: x86_64-apple-darwin
# "macos-latest" is actually an ARM runner, hence using the ARM target for mac here
target: aarch64-apple-darwin
github-token: ${{ secrets.GITHUB_TOKEN }}
engine-version: ${{ matrix.engine.version }}

Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/setup-php-extension/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,35 @@ inputs:
description: Whether to install composer dependencies
required: false
default: "true"
target:
description: "Specified target for rust toolchain, ex. x86_64-apple-darwin"
type: string
required: false
defalt: "x86_64-unknown-linux-gnu"
options:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
os:
description: "The current operating system"
required: true
type: string
options:
- amazon-linux
- macos
- ubuntu

runs:
using: composite
steps:
- name: Install shared dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
target: x86_64-unknown-linux-gnu
os: ${{ inputs.os }}
target: ${{ inputs.target }}
github-token: ${{ github.token }}
engine-version: "7.2.5"

Expand All @@ -28,7 +49,8 @@ runs:
extensions: none
tools: pie, jq

- name: Install system dependencies
- name: Install system dependencies for Ubuntu
if: inputs.os == 'ubuntu'
shell: bash
env:
PHP_VERSION: ${{ inputs.php-version }}
Expand All @@ -49,6 +71,12 @@ runs:
libprotobuf-c-dev \
libprotobuf-c1

- name: Install system dependencies for macOS
if: inputs.os == 'macos'
shell: bash
run: |
brew install autoconf automake libtool pkg-config protobuf-c clang-format

- name: Install Rust and protoc
uses: ./.github/workflows/install-rust-and-protoc
with:
Expand Down
47 changes: 45 additions & 2 deletions .github/workflows/test-pie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
with:
php-version: ${{ matrix.php }}
install-composer-deps: "true"
target: ${{ matrix.host.TARGET }}
os: ${{ matrix.host.OS }}

- name: Create manual Composer repository
run: |
Expand Down Expand Up @@ -97,7 +99,20 @@ jobs:
# Start HTTP server
cd web && python3 -m http.server 8000 &
echo $! > ../server.pid
sleep 3

# Wait for server to be ready with proper health check
echo "Waiting for HTTP server to start..."
for i in {1..30}; do
if curl -s http://localhost:8000/packages.json >/dev/null 2>&1; then
echo "HTTP server is ready"
break
fi
if [ $i -eq 30 ]; then
echo "HTTP server failed to start after 30 seconds"
exit 1
fi
sleep 1
done

- name: Test PIE with manual repository
run: |
Expand All @@ -107,7 +122,10 @@ jobs:

# Initialize composer config directories and fix permissions
mkdir -p "$HOME/.config/composer"
sudo mkdir -p /root/.config/composer
# Skip root directory creation on macOS due to SIP
if [[ "${{ matrix.host.OS }}" != "macos" ]]; then
sudo mkdir -p /root/.config/composer
fi

# Make sure root can read the user's composer config
sudo chmod -R 755 "$HOME/.config/composer"
Expand All @@ -117,6 +135,17 @@ jobs:
sudo chown -R root:root "$HOME/.config/composer" || true
fi

# Verify HTTP server is accessible before proceeding
echo "=== Verifying HTTP server accessibility ==="
curl -v http://localhost:8000/packages.json || {
echo "ERROR: Cannot access local HTTP server"
echo "Server process status:"
ps aux | grep "python.*http.server" || echo "No HTTP server process found"
echo "Port 8000 status:"
lsof -i :8000 || echo "Port 8000 not in use"
exit 1
}

# Add local repository
pie repository:add composer http://localhost:8000

Expand Down Expand Up @@ -201,6 +230,20 @@ jobs:
php-config --extension-dir
ls -la $(php-config --extension-dir) | grep valkey || echo "valkey_glide.so not found in extension directory"

# Check if PIE installed to a different location (macOS Homebrew specific)
if [[ "${{ matrix.host.OS }}" == "macos" ]]; then
echo "=== Checking alternative extension locations ==="
find /opt/homebrew/lib/php -name "valkey_glide.so" 2>/dev/null || echo "No valkey_glide.so found in /opt/homebrew/lib/php"

# If found in alternative location, create symlink
ALT_SO=$(find /opt/homebrew/lib/php -name "valkey_glide.so" 2>/dev/null | head -1)
if [ -n "$ALT_SO" ] && [ ! -f "$(php-config --extension-dir)/valkey_glide.so" ]; then
echo "Found extension at: $ALT_SO"
echo "Creating symlink to: $(php-config --extension-dir)/valkey_glide.so"
sudo ln -sf "$ALT_SO" "$(php-config --extension-dir)/valkey_glide.so"
fi
fi

echo "=== Looking for built extension in PIE working directory ==="
PIE_WORK_DIR=$(find "$HOME/.config/pie" -name "valkey-glide-php" -type d | head -1)
if [ -n "$PIE_WORK_DIR" ]; then
Expand Down
32 changes: 0 additions & 32 deletions .vscode/launch.json

This file was deleted.

86 changes: 0 additions & 86 deletions .vscode/settings.json

This file was deleted.

41 changes: 0 additions & 41 deletions .vscode/tasks.json

This file was deleted.

Loading