Skip to content

Commit 8534d98

Browse files
authored
fix broken CI jobs (#181)
* fix missing Swoole Library class during bootstrap * remove docker compose flags in CI, just to make CI work * fix pdo_oci installation under PHP 8.4
1 parent e684762 commit 8534d98

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ jobs:
1212
image-tag-prefix: ["", "6.0-"]
1313
php: ["8.1", "8.2", "8.3", "8.4"]
1414

15-
name: Run Tests Using Image phpswoole/swoole:${{ matrix.image-tag-prefix }}php${{ matrix.php }}
15+
name: Image phpswoole/swoole:${{ matrix.image-tag-prefix }}php${{ matrix.php }}
1616

1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020

2121
- name: Start Docker Containers
2222
uses: hoverkraft-tech/compose-action@v2.2.0
23-
with:
24-
up-flags: "--build --abort-on-container-exit --remove-orphans --renew-anon-volumes"
25-
down-flags: "--volumes"
2623
env:
2724
IMAGE_TAG_PREFIX: ${{ matrix.image-tag-prefix }}
2825
PHP_VERSION: ${{ matrix.php }}

Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ ARG PHP_VERSION=8.3
33

44
FROM phpswoole/swoole:${IMAGE_TAG_PREFIX}php${PHP_VERSION}
55

6-
RUN apt update \
7-
&& apt install -y libaio-dev libc-ares-dev libaio1 supervisor wget git \
6+
RUN set -ex \
7+
&& apt update \
8+
&& apt install -y libaio-dev libc-ares-dev libaio1 supervisor wget git --no-install-recommends \
89
&& wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip \
910
&& unzip instantclient-basiclite-linuxx64.zip && rm -rf META-INF instantclient-basiclite-linuxx64.zip \
1011
&& wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip \
@@ -16,10 +17,12 @@ RUN apt update \
1617
&& echo '/usr/local/instantclient' > /etc/ld.so.conf.d/oracle-instantclient.conf \
1718
&& ldconfig \
1819
&& export ORACLE_HOME=instantclient,/usr/local/instantclient \
19-
&& apt install -y sqlite3 libsqlite3-dev libpq-dev \
20-
&& pecl update-channels \
21-
&& docker-php-ext-install mysqli pdo_oci pdo_pgsql pdo_sqlite \
22-
&& docker-php-ext-enable mysqli pdo_oci pdo_pgsql pdo_sqlite \
20+
&& apt install -y sqlite3 libsqlite3-dev libpq-dev --no-install-recommends \
21+
&& docker-php-ext-install mysqli pdo_pgsql pdo_sqlite \
22+
&& docker-php-ext-enable mysqli pdo_pgsql pdo_sqlite \
23+
&& pecl channel-update pecl \
24+
&& if [ "$(php -r 'echo version_compare(PHP_VERSION, "8.4.0", "<") ? "old" : "new";')" = "old" ] ; then docker-php-ext-install pdo_oci; else pecl install pdo_oci-stable; fi \
25+
&& docker-php-ext-enable pdo_oci \
2326
&& git clone https://github.com/swoole/swoole-src.git \
2427
&& cd ./swoole-src \
2528
&& phpize \
@@ -34,10 +37,10 @@ RUN apt update \
3437
&& make -j$(cat /proc/cpuinfo | grep processor | wc -l) \
3538
&& make install \
3639
&& docker-php-ext-enable swoole \
40+
&& echo "swoole.enable_library=off" >> /usr/local/etc/php/conf.d/docker-php-ext-swoole.ini \
3741
&& php -m \
3842
&& php --ri swoole \
39-
&& echo "swoole.enable_library=off" >> /usr/local/etc/php/conf.d/docker-php-ext-swoole.ini && \
40-
{ \
43+
&& { \
4144
echo '[supervisord]'; \
4245
echo 'user = root'; \
4346
echo ''; \

tests/bootstrap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
use Swoole\Constant;
1313
use Swoole\Coroutine;
1414

15+
if (!defined('SWOOLE_LIBRARY')) {
16+
require_once dirname(__DIR__) . '/vendor/autoload.php';
17+
}
18+
1519
Coroutine::set([
1620
Constant::OPTION_LOG_LEVEL => SWOOLE_LOG_INFO,
1721
Constant::OPTION_TRACE_FLAGS => 0,
1822
]);
1923

20-
if (!defined('SWOOLE_LIBRARY')) {
21-
require_once dirname(__DIR__) . '/vendor/autoload.php';
22-
}
23-
2424
if (!defined('MYSQL_SERVER_HOST')) {
2525
define('MYSQL_SERVER_HOST', 'mysql');
2626
define('MYSQL_SERVER_PORT', 3306);

0 commit comments

Comments
 (0)