Skip to content

Commit

Permalink
Merge pull request #182 from rryqszq4/development
Browse files Browse the repository at this point in the history
[pr] release version to 0.0.28
  • Loading branch information
rryqszq4 authored Dec 5, 2023
2 parents 35d6fb3 + 915ec3c commit c3eccb0
Show file tree
Hide file tree
Showing 23 changed files with 5,874 additions and 124 deletions.
4 changes: 2 additions & 2 deletions .github/ngx-php/compile-ngx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export PHP_CONFIG="/usr/bin/php-config$PHP_SRC_VERSION"
export PHP_LIB='/usr/lib'
export NGX_PHP_LIBS="`$PHP_CONFIG --ldflags` `$PHP_CONFIG --libs` -L$PHP_LIB -lphp$PHP_MAJOR_VERSION "

php-config$PHP_SRC_VERSION
php-config
#ls ${PHP_SRC_ROOT}

echo "Nginx install ..."
Expand All @@ -47,7 +47,7 @@ else
--add-dynamic-module=../third_party/ngx_devel_kit \
--add-dynamic-module=..
fi
make
make -j$(nproc)
make install
if [ $? -eq 0 ];then
echo "Nginx install ... done"
Expand Down
20 changes: 13 additions & 7 deletions .github/ngx-php/compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ echo "php install ..."
--without-pear \
--disable-cli \
--disable-cgi \
--enable-dtrace \
--enable-opcache \
--enable-embed=shared
make
make -j$(nproc)
make install
#sudo ln -s ${PHP_SRC_ROOT}/lib/libphp7.so /usr/lib/libphp7.so
#sudo ln -s ${PHP_SRC_ROOT}/lib/libphp7.so /usr/local/lib/libphp7.so
echo "php install ... done"
cp php.ini-production ${PHP_SRC_ROOT}'/php.ini'

# Show php-config
../php/bin/php-config

cd ..
echo "nginx download ..."
wget http://nginx.org/download/nginx-${NGINX_SRC_VERSION}.tar.gz
Expand All @@ -81,19 +84,22 @@ export NGX_PHP_LIBS="`$PHP_CONFIG --ldflags` `$PHP_CONFIG --libs` -L$PHP_LIB -lp

ls ${PHP_SRC_ROOT}

# Show pwd
pwd

echo "nginx install ..."
if [ ! "${NGINX_MODULE}" = "DYNAMIC" ]; then
./configure --prefix=${NGINX_SRC_ROOT} \
--with-ld-opt="-Wl,-rpath,$PHP_LIB" \
--add-module=../../../ngx_php7/third_party/ngx_devel_kit \
--add-module=../../../ngx_php7
--add-module=../../third_party/ngx_devel_kit \
--add-module=../..
else
./configure --prefix=${NGINX_SRC_ROOT} \
--with-ld-opt="-Wl,-rpath,$PHP_LIB" \
--add-dynamic-module=../../../ngx_php7/third_party/ngx_devel_kit \
--add-dynamic-module=../../../ngx_php7
--add-dynamic-module=../../third_party/ngx_devel_kit \
--add-dynamic-module=../..
fi
make
make -j$(nproc)
make install
if [ $? -eq 0 ];then
echo "nginx install ... done"
Expand Down
4 changes: 4 additions & 0 deletions .github/ngx-php/php/99-opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
; priority=99
# bypass the forced JIT disabled in ondrej ppa
zend_extension=opcache.so
opcache.jit=tracing
1 change: 1 addition & 0 deletions .github/ngx-php/php/99-xdebug.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
; priority=99
xdebug.mode=off
4 changes: 3 additions & 1 deletion .github/ngx-php/php/php.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
zend_extension=opcache.so

opcache.enable=1
opcache.enable_cli=1
#opcache.validate_timestamps=0
Expand All @@ -7,4 +9,4 @@ opcache.enable_cli=1
#memory_limit = 512M

opcache.jit_buffer_size=128M
opcache.jit=tracing
opcache.jit=tracing
21 changes: 18 additions & 3 deletions .github/ngx-php/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,25 @@

# Show PHP cli
echo "PHP version ..."
/usr/bin/php${PHP_SRC_VERSION} -v

PHP_COMPILE_PATH=`pwd`'/build/php'
if [ -d "$PHP_COMPILE_PATH" ]; then
${PHP_COMPILE_PATH}'/bin/php-config'
else
/usr/bin/php${PHP_SRC_VERSION} -v
fi

ls

echo "Ngx-php test ..."
NGX_PATH=`pwd`'/nginx/sbin'

NGINX_COMPILE_PATH=`pwd`'/build/nginx/sbin'
if [ -d "$NGINX_COMPILE_PATH" ]; then
NGX_PATH=${NGINX_COMPILE_PATH}
else
NGX_PATH=`pwd`'/nginx/sbin'
fi

${NGX_PATH}/nginx -V
export PATH=${NGX_PATH}:$PATH
NGX_MODULE_PATH=`pwd`'/nginx/modules'
Expand All @@ -19,5 +34,5 @@ fi

export TRAVIS_BUILD_DIR=`pwd`
echo $TRAVIS_BUILD_DIR
ls

prove -r t
5,437 changes: 5,437 additions & 0 deletions .github/ngx-php/world.sql

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build

on:
push:
paths:
- "src/**"
- "t/**"
- "third_party/**"
- ".github/**"
pull_request:
paths:
- "src/**"
- "t/**"
- "third_party/**"
- ".github/**"

# later try to pass it, and not repeat it in workflows
env:
DB_DATABASE: ngx_php
DB_USER: ngx_php
DB_PASSWORD: ngx_php

jobs:
build_php_22-04:
name: Compile PHP Ubuntu 22.04
if: ${{ contains(github.event.head_commit.message, '<compile') }}
uses: ./.github/workflows/build_22.04.yml

build_20-04:
name: Ubuntu 20.04
if: ${{ !contains(github.event.head_commit.message, '<20') }}
uses: ./.github/workflows/build_20.04.yml

build_dynamic_20-04:
name: Ubuntu 20.04 dynamic
if: ${{ !contains(github.event.head_commit.message, '<20') }}
uses: ./.github/workflows/build_20.04_dynamic.yml

build_dynamic_22-04:
name: Ubuntu 22.04 dynamic
if: ${{ contains(github.event.head_commit.message, '<22') }}
uses: ./.github/workflows/build_22.04_dynamic.yml

68 changes: 68 additions & 0 deletions .github/workflows/build_20.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build test 20.04

on:
workflow_call:

env:
DB_DATABASE: ngx_php
DB_USER: ngx_php
DB_PASSWORD: ngx_php

jobs:
build:
runs-on: ubuntu-20.04

strategy:
matrix:
php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
ngxinx_version: ["1.20.2", "1.22.1", "1.24.0"] # "1.12.2" fail to compile
# Disable fail-fast to allow all failing versions to fail in a
# single build, rather than stopping when the first one fails.
fail-fast: false

name: PHP-${{ matrix.php_version }} Nginx ${{ matrix.ngxinx_version }}

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev

- name: Setup PHP-${{ matrix.php_version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: dev, embed, opcache, mysql
ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL
coverage: none

- name: Download Nginx v${{ matrix.ngxinx_version }}
run: |
wget http://nginx.org/download/nginx-${{ matrix.ngxinx_version }}.tar.gz
tar -zxf nginx-${{ matrix.ngxinx_version }}.tar.gz
- name: Compile Ngx-php
env:
PHP_SRC_VERSION: ${{ matrix.php_version }}
NGINX_SRC_VERSION: ${{ matrix.ngxinx_version }}
run: ./.github/ngx-php/compile-ngx.sh

- name: MySQL Start and create table
run: |
sudo systemctl start mysql.service
mysql -uroot -proot -e 'CREATE DATABASE ${{ env.DB_DATABASE }};'
mysql -uroot -proot < .github/ngx-php/world.sql
- name: Install Redis & Memcached
run: |
sudo apt-get install -y redis-server redis-tools memcached
sudo redis-server /etc/redis/redis.conf
- name: Perl packages
run: sudo cpanm -n Test::Nginx

- name: Test
env:
PHP_SRC_VERSION: ${{ matrix.php_version }}
run: |
sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini
./.github/ngx-php/test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
name: Build dynamic test
name: Build dynamic test 20.04

on:
push:
paths:
- "src/**"
- "t/**"
- "third_party/**"
- ".github/**"
pull_request:
paths:
- "src/**"
- "t/**"
- "third_party/**"
- ".github/**"
workflow_call:

env:
DB_DATABASE: ngx_php
Expand All @@ -25,8 +14,8 @@ jobs:

strategy:
matrix:
php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
ngxinx_version: ["1.20.2", "1.22.1", "1.23.4"] # "1.12.2" fail to compile
php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
ngxinx_version: ["1.20.2", "1.22.1", "1.24.0"] # "1.12.2" fail to compile
# Disable fail-fast to allow all failing versions to fail in a
# single build, rather than stopping when the first one fails.
fail-fast: false
Expand All @@ -36,13 +25,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update -yqq >/dev/null && sudo apt-get upgrade -yqq >/dev/null
run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev

- name: Install PHP-${{ matrix.php_version }}
run: sudo apt-get install php${{ matrix.php_version }}-cli php${{ matrix.php_version }}-dev libphp${{ matrix.php_version }}-embed php${{ matrix.php_version }}-mysql
- name: Setup PHP-${{ matrix.php_version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: dev, embed, opcache, mysql
ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL
coverage: none

- name: Download Nginx v${{ matrix.ngxinx_version }}
run: |
Expand All @@ -60,10 +51,7 @@ jobs:
run: |
sudo systemctl start mysql.service
mysql -uroot -proot -e 'CREATE DATABASE ${{ env.DB_DATABASE }};'
if [ ! -d data-cache ]; then mkdir data-cache; fi
if [ ! -f data-cache/world-db.tar.gz ]; then wget -O data-cache/world-db.tar.gz https://downloads.mysql.com/docs/world-db.tar.gz; fi
tar zxvf data-cache/world-db.tar.gz
mysql -uroot -proot < world-db/world.sql
mysql -uroot -proot < .github/ngx-php/world.sql
- name: Install Redis & Memcached
run: |
Expand All @@ -77,6 +65,5 @@ jobs:
env:
PHP_SRC_VERSION: ${{ matrix.php_version }}
run: |
sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/embed/conf.d/
sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/cli/conf.d/
sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini
./.github/ngx-php/test.sh
41 changes: 15 additions & 26 deletions .github/workflows/ngx_php.yml → .github/workflows/build_22.04.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
name: Build test
name: 22.04 Ngx-php & PHP build test

on:
push:
paths:
- "src/**"
- "t/**"
- "third_party/**"
- ".github/**"
pull_request:
paths:
- "src/**"
- "t/**"
- "third_party/**"
- ".github/**"
workflow_call:

env:
DB_DATABASE: ngx_php
Expand All @@ -21,12 +10,12 @@ env:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
ngxinx_version: ["1.20.2", "1.22.1", "1.23.4"] # "1.12.2" fail to compile
php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
ngxinx_version: ["1.20.2", "1.22.1", "1.24.0"] # "1.12.2" fail to compile
# Disable fail-fast to allow all failing versions to fail in a
# single build, rather than stopping when the first one fails.
fail-fast: false
Expand All @@ -36,13 +25,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update -yqq >/dev/null && sudo apt-get upgrade -yqq >/dev/null
run: sudo apt-get install -yqq cpanminus libxml2-dev systemtap-sdt-dev zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev

- name: Install PHP-${{ matrix.php_version }}
run: sudo apt-get install php${{ matrix.php_version }}-cli php${{ matrix.php_version }}-dev libphp${{ matrix.php_version }}-embed php${{ matrix.php_version }}-mysql
- name: Setup PHP-${{ matrix.php_version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: dev, embed, opcache, mysql
ini-values: opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M,error_reporting=E_ALL
coverage: none

- name: Download Nginx v${{ matrix.ngxinx_version }}
run: |
Expand All @@ -59,10 +50,7 @@ jobs:
run: |
sudo systemctl start mysql.service
mysql -uroot -proot -e 'CREATE DATABASE ${{ env.DB_DATABASE }};'
if [ ! -d data-cache ]; then mkdir data-cache; fi
if [ ! -f data-cache/world-db.tar.gz ]; then wget -O data-cache/world-db.tar.gz https://downloads.mysql.com/docs/world-db.tar.gz; fi
tar zxvf data-cache/world-db.tar.gz
mysql -uroot -proot < world-db/world.sql
mysql -uroot -proot < .github/ngx-php/world.sql
- name: Install Redis & Memcached
run: |
Expand All @@ -78,4 +66,5 @@ jobs:
run: |
sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/embed/conf.d/
sudo cp .github/ngx-php/php/99-xdebug.ini /etc/php/${PHP_SRC_VERSION}/cli/conf.d/
sudo sed -i "s|opcache.jit=off|opcache.jit=tracing|g" /etc/php/${PHP_SRC_VERSION}/embed/conf.d/10-opcache.ini
./.github/ngx-php/test.sh
Loading

0 comments on commit c3eccb0

Please sign in to comment.