From 8cf1902c25982359318da718d26e652dc3456852 Mon Sep 17 00:00:00 2001 From: Sarah Michels Date: Tue, 28 Jul 2026 15:31:50 -0700 Subject: [PATCH 1/5] feat(ci): add Valkey GLIDE install action and with_valkey_glide workflow input Centralize valkey_glide pecl install for PHP CI workflows. Adds optional with_valkey_glide on php-stan, php-cs-fixer, and php-laravel-test. Co-authored-by: Cursor --- .../actions/install-valkey-glide/action.yml | 51 +++++++++++++++++++ .github/workflows/php-cs-fixer.yaml | 11 +++- .github/workflows/php-laravel-test.yaml | 9 ++++ .github/workflows/php-stan.yaml | 17 +++++-- 4 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 .github/actions/install-valkey-glide/action.yml diff --git a/.github/actions/install-valkey-glide/action.yml b/.github/actions/install-valkey-glide/action.yml new file mode 100644 index 0000000..9341771 --- /dev/null +++ b/.github/actions/install-valkey-glide/action.yml @@ -0,0 +1,51 @@ +name: Install Valkey GLIDE extension +description: Install valkey_glide PHP extension from a GitHub release tarball + +inputs: + version: + description: Valkey GLIDE PHP release version + required: false + default: "1.1.2" + +runs: + using: composite + steps: + - name: Install valkey_glide build dependencies + shell: bash + run: | + sudo apt-get update -y + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \ + build-essential \ + git \ + libffi-dev \ + pkg-config \ + python3 \ + libprotobuf-c-dev \ + libssl-dev \ + protobuf-compiler \ + protobuf-c-compiler + + - name: Install Rust toolchain and cbindgen + shell: bash + run: | + if ! command -v cargo >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + fi + . "$HOME/.cargo/env" + export PATH="$HOME/.cargo/bin:$PATH" + rustup default stable + if ! command -v cbindgen >/dev/null 2>&1; then + cargo install cbindgen + fi + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - name: Install valkey_glide + shell: bash + run: | + . "$HOME/.cargo/env" + export PATH="$HOME/.cargo/bin:$PATH" + curl -fsSL -o /tmp/valkey_glide.tgz \ + "https://github.com/valkey-io/valkey-glide-php/releases/download/v${{ inputs.version }}/valkey_glide-${{ inputs.version }}.tgz" + sudo env HOME="$HOME" CARGO_HOME="$HOME/.cargo" PATH="$PATH" pecl install /tmp/valkey_glide.tgz + echo "extension=valkey_glide.so" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/99-valkey_glide.ini" + rm -f /tmp/valkey_glide.tgz diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index 62d9bf0..c61c668 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -23,6 +23,11 @@ on: required: false type: string default: "chore(php-cs-fixer): fix code style issues" + with_valkey_glide: + description: "Install valkey_glide PHP extension before composer install" + required: false + type: boolean + default: false secrets: packagist_username: required: true @@ -35,8 +40,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 - with: - ref: ${{ github.head_ref }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -44,6 +47,10 @@ jobs: php-version: "${{ inputs.php_version }}" tools: composer:v2 + - name: Install Valkey GLIDE extension + if: ${{ inputs.with_valkey_glide }} + uses: ./.github/actions/install-valkey-glide + - name: Cache PHP CS Fixer uses: actions/cache@v5 with: diff --git a/.github/workflows/php-laravel-test.yaml b/.github/workflows/php-laravel-test.yaml index e9906f4..d9f27c3 100644 --- a/.github/workflows/php-laravel-test.yaml +++ b/.github/workflows/php-laravel-test.yaml @@ -30,6 +30,11 @@ on: type: string required: false default: "" + with_valkey_glide: + description: "Install valkey_glide PHP extension before composer install" + required: false + type: boolean + default: false secrets: packagist_username: required: true @@ -68,6 +73,10 @@ jobs: - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Install Valkey GLIDE extension + if: ${{ inputs.with_valkey_glide }} + uses: ./.github/actions/install-valkey-glide + - name: Install composer dependencies uses: ramsey/composer-install@v2 with: diff --git a/.github/workflows/php-stan.yaml b/.github/workflows/php-stan.yaml index 7e9d929..a7abfc8 100644 --- a/.github/workflows/php-stan.yaml +++ b/.github/workflows/php-stan.yaml @@ -31,6 +31,11 @@ on: required: false type: string default: "ubuntu-latest" + with_valkey_glide: + description: "Install valkey_glide PHP extension before composer install" + required: false + type: boolean + default: false secrets: packagist_username: required: true @@ -51,8 +56,15 @@ jobs: coverage: none php-version: ${{ inputs.php_version }} tools: composer + + - name: Install Valkey GLIDE extension + if: ${{ inputs.with_valkey_glide }} + uses: ./.github/actions/install-valkey-glide + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 env: - COMPOSER_AUTH_JSON: | + COMPOSER_AUTH: | { "http-basic": { "repo.packagist.com": { @@ -62,9 +74,6 @@ jobs: } } - - name: Install composer dependencies - uses: ramsey/composer-install@v2 - - name: Restore PHPStan Cache uses: actions/cache/restore@v4 with: From be5c23bd36a35feda49d1feaa75f89c2b2b866a3 Mon Sep 17 00:00:00 2001 From: Sarah Michels Date: Tue, 28 Jul 2026 15:59:37 -0700 Subject: [PATCH 2/5] fix(ci): use fully-qualified action ref for valkey_glide install Local `./` action paths resolve against the caller's checkout in workflow_call workflows, so cross-repo callers setting with_valkey_glide failed with "Can't find action.yml". Reference the composite via its fully-qualified encodium/.github path so it resolves regardless of the caller's checked-out repo. Ref pinned to the PLAT-5055 branch for pre-merge testing; must be switched to @main before merge. Co-authored-by: Cursor --- .github/workflows/php-cs-fixer.yaml | 2 +- .github/workflows/php-laravel-test.yaml | 2 +- .github/workflows/php-stan.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index c61c668..1042512 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -49,7 +49,7 @@ jobs: - name: Install Valkey GLIDE extension if: ${{ inputs.with_valkey_glide }} - uses: ./.github/actions/install-valkey-glide + uses: encodium/.github/.github/actions/install-valkey-glide@PLAT-5055-valkey-glide-ci - name: Cache PHP CS Fixer uses: actions/cache@v5 diff --git a/.github/workflows/php-laravel-test.yaml b/.github/workflows/php-laravel-test.yaml index d9f27c3..1f7492a 100644 --- a/.github/workflows/php-laravel-test.yaml +++ b/.github/workflows/php-laravel-test.yaml @@ -75,7 +75,7 @@ jobs: - name: Install Valkey GLIDE extension if: ${{ inputs.with_valkey_glide }} - uses: ./.github/actions/install-valkey-glide + uses: encodium/.github/.github/actions/install-valkey-glide@PLAT-5055-valkey-glide-ci - name: Install composer dependencies uses: ramsey/composer-install@v2 diff --git a/.github/workflows/php-stan.yaml b/.github/workflows/php-stan.yaml index a7abfc8..28be6c9 100644 --- a/.github/workflows/php-stan.yaml +++ b/.github/workflows/php-stan.yaml @@ -59,7 +59,7 @@ jobs: - name: Install Valkey GLIDE extension if: ${{ inputs.with_valkey_glide }} - uses: ./.github/actions/install-valkey-glide + uses: encodium/.github/.github/actions/install-valkey-glide@PLAT-5055-valkey-glide-ci - name: Install composer dependencies uses: ramsey/composer-install@v2 From 965ff718cc564b24621e56d228d2dd2801927073 Mon Sep 17 00:00:00 2001 From: Sarah Michels Date: Tue, 28 Jul 2026 16:23:41 -0700 Subject: [PATCH 3/5] fix(ci): pin valkey_glide install action to @main Use the stable main ref instead of the feature branch so merged workflows do not depend on a temporary branch name. Co-authored-by: Cursor --- .github/workflows/php-cs-fixer.yaml | 2 +- .github/workflows/php-laravel-test.yaml | 2 +- .github/workflows/php-stan.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index 1042512..09172d7 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -49,7 +49,7 @@ jobs: - name: Install Valkey GLIDE extension if: ${{ inputs.with_valkey_glide }} - uses: encodium/.github/.github/actions/install-valkey-glide@PLAT-5055-valkey-glide-ci + uses: encodium/.github/.github/actions/install-valkey-glide@main - name: Cache PHP CS Fixer uses: actions/cache@v5 diff --git a/.github/workflows/php-laravel-test.yaml b/.github/workflows/php-laravel-test.yaml index 1f7492a..86f5ed3 100644 --- a/.github/workflows/php-laravel-test.yaml +++ b/.github/workflows/php-laravel-test.yaml @@ -75,7 +75,7 @@ jobs: - name: Install Valkey GLIDE extension if: ${{ inputs.with_valkey_glide }} - uses: encodium/.github/.github/actions/install-valkey-glide@PLAT-5055-valkey-glide-ci + uses: encodium/.github/.github/actions/install-valkey-glide@main - name: Install composer dependencies uses: ramsey/composer-install@v2 diff --git a/.github/workflows/php-stan.yaml b/.github/workflows/php-stan.yaml index 28be6c9..9732a3c 100644 --- a/.github/workflows/php-stan.yaml +++ b/.github/workflows/php-stan.yaml @@ -59,7 +59,7 @@ jobs: - name: Install Valkey GLIDE extension if: ${{ inputs.with_valkey_glide }} - uses: encodium/.github/.github/actions/install-valkey-glide@PLAT-5055-valkey-glide-ci + uses: encodium/.github/.github/actions/install-valkey-glide@main - name: Install composer dependencies uses: ramsey/composer-install@v2 From d43f78a782609a94eaf3b320a8fa3d5e261b5fc9 Mon Sep 17 00:00:00 2001 From: Sarah Michels Date: Tue, 28 Jul 2026 16:42:06 -0700 Subject: [PATCH 4/5] fix(ci): make valkey_glide pecl install non-interactive Pipe empty responses into pecl install so configure prompts such as enable-valkey-glide-debug do not block CI jobs waiting for stdin. Co-authored-by: Cursor --- .github/actions/install-valkey-glide/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-valkey-glide/action.yml b/.github/actions/install-valkey-glide/action.yml index 9341771..dc10fe4 100644 --- a/.github/actions/install-valkey-glide/action.yml +++ b/.github/actions/install-valkey-glide/action.yml @@ -46,6 +46,6 @@ runs: export PATH="$HOME/.cargo/bin:$PATH" curl -fsSL -o /tmp/valkey_glide.tgz \ "https://github.com/valkey-io/valkey-glide-php/releases/download/v${{ inputs.version }}/valkey_glide-${{ inputs.version }}.tgz" - sudo env HOME="$HOME" CARGO_HOME="$HOME/.cargo" PATH="$PATH" pecl install /tmp/valkey_glide.tgz + yes '' | sudo env HOME="$HOME" CARGO_HOME="$HOME/.cargo" PATH="$PATH" pecl install /tmp/valkey_glide.tgz echo "extension=valkey_glide.so" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/99-valkey_glide.ini" rm -f /tmp/valkey_glide.tgz From c707b915effa6e6a9963c7b60a022921263483d8 Mon Sep 17 00:00:00 2001 From: Sarah Michels Date: Tue, 28 Jul 2026 16:49:39 -0700 Subject: [PATCH 5/5] fix(ci): ignore SIGPIPE from yes during pecl install With pipefail enabled, yes exits 141 when pecl closes stdin after a successful install. Treat that exit code as success so the step does not fail after valkey_glide is installed. Co-authored-by: Cursor --- .github/actions/install-valkey-glide/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-valkey-glide/action.yml b/.github/actions/install-valkey-glide/action.yml index dc10fe4..77cd9b9 100644 --- a/.github/actions/install-valkey-glide/action.yml +++ b/.github/actions/install-valkey-glide/action.yml @@ -46,6 +46,6 @@ runs: export PATH="$HOME/.cargo/bin:$PATH" curl -fsSL -o /tmp/valkey_glide.tgz \ "https://github.com/valkey-io/valkey-glide-php/releases/download/v${{ inputs.version }}/valkey_glide-${{ inputs.version }}.tgz" - yes '' | sudo env HOME="$HOME" CARGO_HOME="$HOME/.cargo" PATH="$PATH" pecl install /tmp/valkey_glide.tgz + yes '' | sudo env HOME="$HOME" CARGO_HOME="$HOME/.cargo" PATH="$PATH" pecl install /tmp/valkey_glide.tgz || [[ $? -eq 141 ]] echo "extension=valkey_glide.so" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/99-valkey_glide.ini" rm -f /tmp/valkey_glide.tgz