Skip to content

Commit 4b32dc6

Browse files
committed
install swoole for the specific php version
Signed-off-by: bota <[email protected]>
1 parent 4d28177 commit 4b32dc6

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,5 @@ on:
77
tags:
88

99
jobs:
10-
mutation:
11-
runs-on: ${{ matrix.os }}
12-
13-
strategy:
14-
matrix:
15-
os:
16-
- ubuntu-latest
17-
18-
php:
19-
- "8.2"
20-
- "8.3"
21-
steps:
22-
- name: Setup PHP with required extensions
23-
uses: shivammathur/setup-php@v2
24-
with:
25-
extensions: redis
2610
ci:
2711
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]
28-

.laminas-ci/pre-run.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
JOB=$3
2-
PHP_VERSION=$4
3-
COMMAND=$(echo "${JOB}" | jq -r '.command')
1+
#!/usr/bin/env bash
42

5-
echo "Running pre-run $COMMAND"
3+
set -e
64

7-
apt-get install -y php-dev php-pear
8-
pecl install redis
9-
echo "extension=redis.so" | sudo tee -a /etc/php/${PHP_VERSION}/cli/php.ini
5+
PHP_VERSION=$(php -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;')
6+
7+
if [[ "$PHP_VERSION" == "8.2" ]]; then
8+
pecl install swoole-5.0.3
9+
elif [[ "$PHP_VERSION" == "8.3" ]]; then
10+
pecl install swoole-5.1.0
11+
else
12+
13+
echo "Unsupported PHP version: $PHP_VERSION"
14+
exit 1
15+
fi
16+
17+
echo "extension=swoole.so" >> "$(php -r 'echo php_ini_loaded_file();')"

0 commit comments

Comments
 (0)