Skip to content
Merged
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
51 changes: 51 additions & 0 deletions .github/actions/install-valkey-glide/action.yml
Original file line number Diff line number Diff line change
@@ -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"
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
11 changes: 9 additions & 2 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,15 +40,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ inputs.php_version }}"
tools: composer:v2

- name: Install Valkey GLIDE extension
if: ${{ inputs.with_valkey_glide }}
uses: encodium/.github/.github/actions/install-valkey-glide@main

- name: Cache PHP CS Fixer
uses: actions/cache@v5
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/php-laravel-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: encodium/.github/.github/actions/install-valkey-glide@main

- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/php-stan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: encodium/.github/.github/actions/install-valkey-glide@main

- name: Install composer dependencies
uses: ramsey/composer-install@v2
env:
COMPOSER_AUTH_JSON: |
COMPOSER_AUTH: |
{
"http-basic": {
"repo.packagist.com": {
Expand All @@ -62,9 +74,6 @@ jobs:
}
}

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Restore PHPStan Cache
uses: actions/cache/restore@v4
with:
Expand Down