Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ci #364

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
49bdd64
build(deps): bump actions/download-artifact in /.github/workflows
dependabot[bot] Sep 3, 2024
6bd77a7
fix: ci
doubaokun Sep 8, 2024
654e13c
update ci for php8.4
doubaokun Dec 29, 2024
77d4d9a
fix
doubaokun Dec 29, 2024
4e7d7b1
fix
doubaokun Dec 29, 2024
b38b7fc
fix
doubaokun Dec 29, 2024
66b5fe3
fix: tests
doubaokun Dec 29, 2024
c6edd95
fix: tests
doubaokun Dec 29, 2024
73c301a
Merge branch 'php84' into dependabot/github_actions/dot-github/workfl…
doubaokun Dec 29, 2024
2d20039
fix: ci
doubaokun Dec 29, 2024
67a4103
fix: ci
doubaokun Dec 29, 2024
9c3a06c
fix: ci
doubaokun Dec 29, 2024
a72ca4f
fix: ci
doubaokun Dec 29, 2024
eb1db64
fix: ci
doubaokun Dec 29, 2024
8edfd9e
fix: ci
doubaokun Dec 29, 2024
99bc5fd
fix: ci
doubaokun Dec 29, 2024
811bef1
fix: ci
doubaokun Dec 29, 2024
bc72971
fix: ci
doubaokun Dec 29, 2024
444d90a
fix: ci
doubaokun Dec 29, 2024
809cfa9
fix: ci
doubaokun Dec 29, 2024
23fa45c
fix: ci
doubaokun Dec 29, 2024
4de8ff2
fix: ci
doubaokun Dec 29, 2024
339e797
fix: ci
doubaokun Dec 29, 2024
204d514
fix: ci
doubaokun Dec 29, 2024
961b4fc
fix: ci
doubaokun Dec 29, 2024
8f4fb56
fix: ci
doubaokun Dec 29, 2024
25c2086
fix: ci
doubaokun Dec 29, 2024
ecce822
fix: ci
doubaokun Dec 29, 2024
e8d11cb
fix: ci
doubaokun Dec 29, 2024
0f07f04
fix: ci
doubaokun Dec 29, 2024
8ee8362
fix: ci
doubaokun Dec 29, 2024
0c9e290
fix: ci
doubaokun Dec 29, 2024
7c0bde6
fix: ci
doubaokun Dec 29, 2024
bf2ef38
fix: ci
doubaokun Dec 29, 2024
47e9d7b
fix: ci
doubaokun Dec 29, 2024
33376bc
fix: ci
doubaokun Dec 29, 2024
6c14be7
fix: ci
doubaokun Dec 29, 2024
97bcf54
fix: ci
doubaokun Dec 29, 2024
c89b309
fix: ci
doubaokun Dec 29, 2024
44b583e
fix: ci
doubaokun Dec 29, 2024
325af59
fix: ci
doubaokun Dec 29, 2024
e26cebc
fix: ci
doubaokun Dec 29, 2024
9723ec6
fix: ci
doubaokun Dec 29, 2024
f2a5f06
fix: ci
doubaokun Dec 29, 2024
d8ae938
fix: ci
doubaokun Dec 29, 2024
bafaa93
fix: ci
doubaokun Dec 29, 2024
721b406
fix: ci
doubaokun Dec 29, 2024
9493972
fix: ci
doubaokun Dec 29, 2024
7eb9913
fix: ci
doubaokun Dec 29, 2024
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
66 changes: 33 additions & 33 deletions .github/workflows/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG ALPINE_VERSION

FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION}

LABEL maintainer="Open Swoole Group <hello@swoole.co.uk>" version="1.0" license="MIT"
LABEL maintainer="Open Swoole Group <hello@openswoole.com>" version="1.0" license="MIT"

ARG PHP_VERSION

Expand All @@ -16,7 +16,7 @@ ENV PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
RUN set -ex \
&& apk update \
&& apk add --no-cache libstdc++ openssl git bash \
&& apk add --no-cache $PHPIZE_DEPS php${PHP_VERSION%\.*\.*}-dev php${PHP_VERSION%\.*\.*}-pear libaio-dev openssl-dev curl-dev \
&& apk add --no-cache $PHPIZE_DEPS php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-dev php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-pear libaio-dev openssl-dev curl-dev \
&& apk add --no-cache ca-certificates \
curl \
wget \
Expand All @@ -25,35 +25,35 @@ RUN set -ex \
libressl \
tzdata \
pcre \
php${PHP_VERSION%\.*\.*}-bcmath \
php${PHP_VERSION%\.*\.*}-curl \
php${PHP_VERSION%\.*\.*}-ctype \
php${PHP_VERSION%\.*\.*}-dom \
php${PHP_VERSION%\.*\.*}-gd \
php${PHP_VERSION%\.*\.*}-iconv \
php${PHP_VERSION%\.*\.*}-mbstring \
php${PHP_VERSION%\.*\.*}-mysqlnd \
php${PHP_VERSION%\.*\.*}-openssl \
php${PHP_VERSION%\.*\.*}-pdo \
php${PHP_VERSION%\.*\.*}-pdo_mysql \
php${PHP_VERSION%\.*\.*}-pdo_sqlite \
php${PHP_VERSION%\.*\.*}-phar \
php${PHP_VERSION%\.*\.*}-posix \
php${PHP_VERSION%\.*\.*}-redis \
php${PHP_VERSION%\.*\.*}-sockets \
php${PHP_VERSION%\.*\.*}-sodium \
php${PHP_VERSION%\.*\.*}-sysvshm \
php${PHP_VERSION%\.*\.*}-sysvmsg \
php${PHP_VERSION%\.*\.*}-sysvsem \
php${PHP_VERSION%\.*\.*}-zip \
php${PHP_VERSION%\.*\.*}-zlib \
php${PHP_VERSION%\.*\.*}-xml \
php${PHP_VERSION%\.*\.*}-xmlreader \
php${PHP_VERSION%\.*\.*}-pcntl \
php${PHP_VERSION%\.*\.*}-opcache \
&& ln -sf /usr/bin/php8 /usr/local/bin/php \
&& ln -sf /usr/bin/phpize8 /usr/local/bin/phpize \
&& ln -sf /usr/bin/php-config8 /usr/local/bin/php-config \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-bcmath \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-curl \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-ctype \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-dom \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-gd \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-iconv \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-mbstring \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-mysqlnd \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-openssl \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-pdo \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-pdo_mysql \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-pdo_sqlite \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-phar \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-posix \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-redis \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-sockets \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-sodium \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-sysvshm \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-sysvmsg \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-sysvsem \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-zip \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-zlib \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-xml \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-xmlreader \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-pcntl \
php${PHP_VERSION:0:1}${PHP_VERSION:2:1}-opcache \
&& ln -sf /usr/bin/php${PHP_VERSION:0:1}${PHP_VERSION:2:1} /usr/local/bin/php \
&& ln -sf /usr/bin/phpize${PHP_VERSION:0:1}${PHP_VERSION:2:1} /usr/local/bin/phpize \
&& ln -sf /usr/bin/php-config${PHP_VERSION:0:1}${PHP_VERSION:2:1} /usr/local/bin/php-config \
&& php -v \
&& php -m \
# ---------- clear works ----------
Expand All @@ -63,8 +63,8 @@ RUN set -ex \
&& phpize \
&& ./configure --enable-openssl --enable-http2 --enable-hook-curl \
&& make -s -j$(nproc) && make install \
&& echo /etc/php${PHP_VERSION%\.*\.*}/conf.d/50_openswoole.ini \
&& echo "extension=openswoole.so" > /etc/php${PHP_VERSION%\.*\.*}/conf.d/50_openswoole.ini \
&& echo /etc/php${PHP_VERSION:0:1}${PHP_VERSION:2:1}/conf.d/50_openswoole.ini \
&& echo "extension=openswoole.so" > /etc/php${PHP_VERSION:0:1}${PHP_VERSION:2:1}/conf.d/50_openswoole.ini \
&& php -v \
&& php -m \
&& php --ri openswoole \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- 1080:1080

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: install dependencies
run: sudo apt update -y && sudo apt install -y googletest libgtest-dev redis-server libboost-stacktrace-dev libbrotli-dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.repository_owner == 'openswoole'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: install-deps
run: sudo apt update -y && sudo apt install -y libcurl4-openssl-dev php-curl libc-ares-dev
- name: phpize
Expand All @@ -28,7 +28,7 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
container: 'centos:latest'
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: fix-repo
run: sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* &&
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
Expand All @@ -45,32 +45,40 @@ jobs:
runs-on: macos-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: install dependencies
run: brew install openssl && brew link openssl && brew install curl && brew link curl && brew install c-ares && brew link c-ares
- uses: actions/checkout@v1
- name: Install dependencies
run: |
brew install autoconf
brew install shivammathur/php/[email protected]
brew link --overwrite --force shivammathur/php/[email protected]
brew install pcre2
brew install c-ares
ln -s /opt/homebrew/include/pcre2.h /opt/homebrew/opt/[email protected]/include/php/ext/pcre/pcre2.h
- uses: actions/checkout@v4
- name: phpize
run: phpize
- name: build1
run: ./configure && make clean && make -j$(sysctl -n hw.ncpu)
- name: build2
run: ./configure --enable-sockets --enable-mysqlnd --enable-http2 --enable-hook-curl
--enable-openssl --with-openssl-dir=/usr/local/opt/[email protected] --enable-cares --enable-debug-log &&
run: |
export CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix c-ares)/include $CFLAGS"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix c-ares)/lib $LDFLAGS"
./configure --enable-sockets --enable-mysqlnd --enable-http2 --enable-hook-curl --enable-openssl --with-openssl-dir=/opt/homebrew/opt/openssl@3 --enable-cares --enable-debug-log
make clean && make -j$(sysctl -n hw.ncpu)

build-alpine-latest:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
php-version: [ '8.1.0']
alpine-version: [ '3.15' ]
php-version: [ '8.2.26']
alpine-version: [ '3.20' ]
include:
- php-version: '8.2.0'
alpine-version: '3.16'
- php-version: '8.3.15'
alpine-version: '3.20'
max-parallel: 8
fail-fast: false
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: build
run: |
cp .github/workflows/alpine.Dockerfile alpine.Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1]
php: [8.2, 8.3]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: test-linux
on:
push:
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
Expand All @@ -13,13 +12,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
php: ['8.2', '8.3']
steps:
- uses: actions/checkout@v1
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: "${{ matrix.php }}"
- uses: actions/checkout@v4
- name: Show machine information
run: |
date
Expand All @@ -34,12 +29,6 @@ jobs:
echo "`git log -10 --stat --pretty --oneline`"
env:
PHP_VERSION: "${{ matrix.php }}"
# - name: Run pecl-install.sh
# run: |
# sudo ${{runner.workspace}}/ext-openswoole/travis/pecl-install.sh
# - name: Run simple-compile-on-github.sh
# run: |
# sudo ${{runner.workspace}}/ext-openswoole/travis/simple-compile-on-github.sh
- name: Run Openswoole test
run: |
export CI_BRANCH=${GITHUB_REF##*/}
Expand All @@ -48,7 +37,7 @@ jobs:
PHP_VERSION: "${{ matrix.php }}"
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: PHP ${{ matrix.php }}
path: tests/test-results.xml
Expand All @@ -61,7 +50,7 @@ jobs:

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: artifacts

Expand Down
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ set(SWOOLE_LINK_LIBRARIES pthread dl)

if (APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
include_directories(BEFORE /usr/local/include)
link_directories(BEFORE /usr/local/lib)
if (EXISTS "/usr/local/include")
include_directories(BEFORE /usr/local/include)
endif()
if (EXISTS "/opt/homebrew/include")
include_directories(BEFORE /opt/homebrew/include)
endif()
if (EXISTS "/usr/local/lib")
link_directories(BEFORE /usr/local/lib)
endif()
if (EXISTS "/opt/homebrew/lib")
link_directories(BEFORE /opt/homebrew/lib)
endif()
else()
list(APPEND SWOOLE_LINK_LIBRARIES rt crypt)
endif()
Expand Down
4 changes: 4 additions & 0 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ if test "$PHP_SWOOLE" != "no"; then
fi

if test "$PHP_CARES" = "yes"; then
if test -d "/opt/homebrew/opt/c-ares/include"; then
CPPFLAGS="$CPPFLAGS -I/opt/homebrew/opt/c-ares/include"
LDFLAGS="$LDFLAGS -L/opt/homebrew/opt/c-ares/lib"
fi
AC_DEFINE(SW_USE_CARES, 1, [do we enable c-ares support])
PHP_ADD_LIBRARY(cares, 1, OPENSWOOLE_SHARED_LIBADD)
fi
Expand Down
1 change: 1 addition & 0 deletions pcre2.h
4 changes: 2 additions & 2 deletions tests/swoole_curl/ssl/version.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ $cm->run(function ($host) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "https://www.qq.com/");
curl_setopt($ch, CURLOPT_URL, "https://openswoole.com/");
$result = curl_exec($ch);
Assert::assert($result);
Assert::contains($result, 'tencent');
Assert::contains($result, 'openswoole');
curl_close($ch);

}, false);
Expand Down
4 changes: 2 additions & 2 deletions tests/swoole_event/add_after_server_start.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ $pm->childFunc = function () use ($pm) {
'log_file' => '/dev/null',
));
$serv->on("start", function (Server $serv) use ($pm) {
$fp = stream_socket_client("tcp://www.qq.com:80", $errno, $errstr, 30);
fwrite($fp, "GET / HTTP/1.1\r\nHost: www.qq.com\r\n\r\n");
$fp = stream_socket_client("tcp://openswoole.com:80", $errno, $errstr, 30);
fwrite($fp, "GET / HTTP/1.1\r\nHost: openswoole.com\r\n\r\n");

swoole_event_add($fp, function ($fp) use ($pm) {
$resp = fread($fp, 8192);
Expand Down
4 changes: 2 additions & 2 deletions tests/swoole_http_client_coro/http_proxy.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ skip_if_offline();
<?php declare(strict_types = 1);
require __DIR__ . '/../include/bootstrap.php';
co::run(function () {
$domain = 'www.qq.com';
$domain = 'openswoole.com';
$cli = new OpenSwoole\Coroutine\Http\Client($domain, 443, true);
// $cli->setHeaders(['Host' => $domain]); // without host header it can also work well
$cli->set([
Expand All @@ -20,7 +20,7 @@ co::run(function () {
]);
$result = $cli->get('/');
Assert::assert($result);
Assert::assert(stripos($cli->body, 'tencent') !== false);
Assert::assert(stripos($cli->body, 'openswoole') !== false);
echo "DONE\n";
});
?>
Expand Down
Loading