Skip to content

Commit

Permalink
feat(openswoole): openswoole support (4.10.0) instead of swoole
Browse files Browse the repository at this point in the history
  • Loading branch information
Rastusik committed Mar 20, 2022
1 parent da5ae2b commit ac7ab0a
Show file tree
Hide file tree
Showing 24 changed files with 1,781 additions and 1,449 deletions.
30 changes: 10 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ aliases:
echo "export TAG='$TAG'" >> $BASH_ENV
if [ "latest" = "$SWOOLE_VERSION" ]; then
LATEST_SWOOLE_VERSION="$(wget -q -O /dev/stdout https://api.github.com/repos/swoole/swoole-src/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')"
LATEST_SWOOLE_VERSION="$(wget -q -O /dev/stdout https://api.github.com/repos/openswoole/swoole-src/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')"
echo "LATEST_SWOOLE_VERSION=$LATEST_SWOOLE_VERSION"
echo "export SWOOLE_VERSION='$LATEST_SWOOLE_VERSION'" >> $BASH_ENV
fi;
Expand Down Expand Up @@ -85,6 +85,13 @@ aliases:
name: Run static anlaysis
command: composer static-analyse-tests

- &job-composer-code-style-lowest
working_directory: /usr/src/app
steps:
- run:
name: Run code style checks
command: composer cs-analyse

- &job-composer-unit-tests
working_directory: /usr/src/app
steps:
Expand Down Expand Up @@ -120,17 +127,10 @@ jobs:
- image: docker.io/pixelfederation/swoole-bundle-composer:7.4-std-$CIRCLE_SHA1

swoole-bundle-composer-74-lowest-code-style:
<<: *job-composer-code-style
<<: *job-composer-code-style-lowest
docker:
- image: docker.io/pixelfederation/swoole-bundle-composer:7.4-lowest-$CIRCLE_SHA1

swoole-bundle-composer-80-latest-code-style:
<<: *job-composer-code-style
environment:
PHP_CS_FIXER_IGNORE_ENV: "1"
docker:
- image: docker.io/pixelfederation/swoole-bundle-composer:8.0-latest-$CIRCLE_SHA1

swoole-bundle-composer-74-unit-tests:
<<: *job-composer-unit-tests
docker:
Expand Down Expand Up @@ -255,7 +255,7 @@ jobs:
PHP_VERSION: "7.4"
PHP_API_VERSION: "20190902"
COMPOSER_ARGS: update --prefer-lowest
SWOOLE_VERSION: "4.5.11"
SWOOLE_VERSION: "4.10.0"
REGISTRY: docker.io
NAMESPACE: pixelfederation
IMAGE: swoole-bundle
Expand Down Expand Up @@ -370,9 +370,6 @@ workflows:
context: swoole-bundle-dockerhub
requires:
- docker-buildx-bake-74
- swoole-bundle-composer-80-latest-code-style:
requires:
- docker-buildx-bake-80-latest
- swoole-bundle-composer-80-latest-unit-tests:
requires:
- docker-buildx-bake-80-latest
Expand Down Expand Up @@ -429,9 +426,6 @@ workflows:
context: swoole-bundle-dockerhub
requires:
- docker-buildx-bake-74
- swoole-bundle-composer-80-latest-code-style:
requires:
- docker-buildx-bake-80-latest
- swoole-bundle-composer-80-latest-unit-tests:
requires:
- docker-buildx-bake-80-latest
Expand Down Expand Up @@ -479,9 +473,6 @@ workflows:
context: swoole-bundle-dockerhub
requires:
- docker-buildx-bake-74
- swoole-bundle-composer-80-latest-code-style:
requires:
- docker-buildx-bake-80-latest
- swoole-bundle-composer-80-latest-unit-tests:
requires:
- docker-buildx-bake-80-latest
Expand All @@ -498,7 +489,6 @@ workflows:
- swoole-bundle-composer-74-lowest-code-style
- swoole-bundle-composer-74-unit-tests
- swoole-bundle-composer-74-code-style
- swoole-bundle-composer-80-latest-code-style
- swoole-bundle-composer-80-latest-unit-tests
- swoole-bundle-composer-80-latest-feature-tests
- releaser:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/vendor
/cov
swoole.pid
.php_cs.cache
clover.xml
**/.phpunit.result.cache
.php-cs-fixer.cache
*.tmp
12 changes: 3 additions & 9 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
->in([__DIR__])
->exclude([
'tests/Fixtures/Symfony/app/var',
'tests/Unit/Server/Php8',
'vendor',
]);

Expand All @@ -15,34 +16,27 @@
*/
return $config->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@PHP73Migration' => true,
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'mb_str_functions' => true,
'native_function_invocation' => true,
'no_null_property_initialization' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_order' => true,
'strict_comparison' => true,
'phpdoc_types_order' => true,
'ordered_class_elements' => true,
'array_indentation' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'no_blank_lines_after_class_opening' => true,
'blank_line_before_statement' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'class_reference_name_casing' => false,
])
->setRiskyAllowed(true)
->setRiskyAllowed(false)
->setFinder($finder);
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG PHP_TAG="7.4-cli-alpine3.13"
ARG COMPOSER_TAG="2.0.11"
ARG COMPOSER_TAG="2.2.9"

FROM php:$PHP_TAG as ext-builder
RUN docker-php-source extract && \
Expand All @@ -20,17 +20,17 @@ FROM ext-builder as ext-xdebug
RUN pecl install xdebug && \
docker-php-ext-enable xdebug

FROM ext-builder as ext-swoole
FROM ext-builder as ext-openswoole
RUN apk add --no-cache git
ARG SWOOLE_VERSION="4.5.11"
ARG SWOOLE_VERSION="4.10.0"
RUN if $(echo "$SWOOLE_VERSION" | grep -qE '^[4-9]\.[0-9]+\.[0-9]+$'); then SWOOLE_GIT_REF="v$SWOOLE_VERSION"; else SWOOLE_GIT_REF="$SWOOLE_VERSION"; fi && \
git clone https://github.com/swoole/swoole-src.git --branch "$SWOOLE_GIT_REF" --depth 1 && \
git clone https://github.com/openswoole/swoole-src.git --branch "$SWOOLE_GIT_REF" --depth 1 && \
cd swoole-src && \
phpize && \
./configure && \
make && \
make install && \
docker-php-ext-enable swoole
docker-php-ext-enable openswoole

FROM ext-builder as ext-pcov
RUN pecl install pcov && \
Expand All @@ -46,8 +46,8 @@ RUN addgroup -g 1000 -S runner && \
RUN apk add --no-cache libstdc++ icu lsof
# php -i | grep 'PHP API' | sed -e 's/PHP API => //'
ARG PHP_API_VERSION="20190902"
COPY --from=ext-swoole /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/swoole.so
COPY --from=ext-swoole /usr/local/etc/php/conf.d/docker-php-ext-swoole.ini /usr/local/etc/php/conf.d/docker-php-ext-swoole.ini
COPY --from=ext-openswoole /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/openswoole.so /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/openswoole.so
COPY --from=ext-openswoole /usr/local/etc/php/conf.d/docker-php-ext-openswoole.ini /usr/local/etc/php/conf.d/docker-php-ext-openswoole.ini
COPY --from=ext-inotify /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/inotify.so /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/inotify.so
COPY --from=ext-inotify /usr/local/etc/php/conf.d/docker-php-ext-inotify.ini /usr/local/etc/php/conf.d/docker-php-ext-inotify.ini
COPY --from=ext-pcntl /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/pcntl.so /usr/local/lib/php/extensions/no-debug-non-zts-${PHP_API_VERSION}/pcntl.so
Expand Down
57 changes: 30 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,44 @@
"require": {
"php": "^7.4|^8.0",
"ext-json": "*",
"ext-swoole": "^4.5.10",
"beberlei/assert": "^3.0",
"symfony/config": "^4.4.0|^5.0",
"symfony/console": "^4.4.0|^5.0",
"symfony/dependency-injection": "^4.4.0|^5.0",
"symfony/http-foundation": "^4.4.0|^5.0",
"symfony/http-kernel": "^4.4.0|^5.0",
"symfony/process": "^4.4.0|^5.0"
"ext-openswoole": "^4.10.0",
"beberlei/assert": "^3.3",
"symfony/config": "^5.4",
"symfony/console": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4",
"symfony/process": "^5.4",
"symfony/proxy-manager-bridge": "^5.4"
},
"require-dev": {
"doctrine/annotations": "^1.6",
"doctrine/orm": "^2.6.3",
"friendsofphp/php-cs-fixer": "^2.19.0",
"jangregor/phpstan-prophecy": "^0.8.0",
"doctrine/annotations": "^1.13",
"doctrine/orm": "^2.11",
"friendsofphp/php-cs-fixer": "^3.7",
"jangregor/phpstan-prophecy": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.0.2",
"phpstan/phpstan": "^0.12.28",
"phpstan/phpstan-beberlei-assert": "^0.12.2",
"phpstan/phpstan-doctrine": "^0.12.9",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-beberlei-assert": "^1.0",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/php-code-coverage": "^9.1.0",
"phpunit/phpcov": "^8.1.0",
"phpunit/phpunit": "^9.1.3",
"swoole/ide-helper": "^4.5.10",
"phpunit/phpcov": "^8.0",
"phpunit/phpunit": "^9.5",
"ramsey/uuid": "^4.1",
"swoole/ide-helper": "^4.8",
"symfony/debug-pack": "^1.0",
"symfony/error-handler": "^4.4.0|^5.0",
"symfony/framework-bundle": "^4.4.0|^5.0",
"symfony/messenger": "^4.4.0|^5.0",
"symfony/monolog-bridge": "^4.4.0|^5.0",
"symfony/doctrine-messenger": "^5.4",
"symfony/error-handler": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/messenger": "^5.4",
"symfony/monolog-bridge": "^5.4",
"symfony/monolog-bundle": "^3.3",
"symfony/profiler-pack": "^1.0",
"symfony/twig-bundle": "^4.4.0|^5.0",
"symfony/var-dumper": "^4.4.0|^5.0",
"symfony/yaml": "^4.4.0|^5.0",
"upscale/swoole-blackfire": "^3.0"
"symfony/twig-bundle": "^5.4",
"symfony/var-dumper": "^5.4",
"symfony/yaml": "^5.4",
"upscale/swoole-blackfire": "^3.1"
},
"suggest": {
"ext-inotify": "To enable HMR",
Expand Down
Loading

0 comments on commit ac7ab0a

Please sign in to comment.