more fixes #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | ||
|
Check failure on line 1 in .github/workflows/ci.yml
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| nginx-version: [1.29.2] | ||
| openssl-version: [3.5.4] | ||
| env: | ||
| JOBS: 3 | ||
| NGX_BUILD_JOBS: ${{ env.JOBS }} | ||
| LUAJIT_PREFIX: /opt/luajit21 | ||
| LUAJIT_LIB: ${{ env.LUAJIT_PREFIX }}/lib | ||
| LUAJIT_INC: ${{ env.LUAJIT_PREFIX }}/include/luajit-2.1 | ||
| LUA_INCLUDE_DIR: ${{ env.LUAJIT_INC }} | ||
| LUA_CMODULE_DIR: /lib | ||
| OPENSSL_PREFIX: /usr/local/openresty/openssl3 | ||
| OPENSSL_LIB: ${{ env.OPENSSL_PREFIX }}/lib | ||
| OPENSSL_INC: ${{ env.OPENSSL_PREFIX }}/include | ||
| LD_LIBRARY_PATH: ${{ env.LUAJIT_LIB }}:${{ env.LD_LIBRARY_PATH }} | ||
| TEST_NGINX_SLEEP: 0.006 | ||
| NGINX_VERSION: ${{ matrix.nginx-version }} | ||
| OPENSSL_VER: ${{ matrix.openssl-version }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y axel wget build-essential | ||
| wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add - | ||
| echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list | ||
| sudo apt-get update | ||
| sudo apt-get install -y openresty-pcre2 openresty-openssl3 openresty-pcre2-dev openresty-openssl3-dev | ||
| - name: Install Perl modules | ||
| run: | | ||
| cpanm --notest Test::Nginx || true | ||
| # If cpanm fails, install cpanminus first | ||
| if [ $? -ne 0 ]; then | ||
| sudo apt-get install -y cpanminus | ||
| cpanm --notest Test::Nginx | ||
| fi | ||
| - name: Clone dependencies | ||
| run: | | ||
| git clone https://github.com/openresty/openresty.git ../openresty | ||
| git clone https://github.com/openresty/nginx-devel-utils.git | ||
| git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module | ||
| git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module | ||
| git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core | ||
| git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache | ||
| git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx | ||
| git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git | ||
| git clone https://github.com/openresty/mockeagain.git | ||
| - name: Build and install LuaJIT | ||
| run: | | ||
| cd luajit2/ | ||
| make -j${{ env.JOBS }} CCDEBUG=-g Q= PREFIX=${{ env.LUAJIT_PREFIX }} CC=gcc XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' | ||
| sudo make install PREFIX=${{ env.LUAJIT_PREFIX }} | ||
| cd .. | ||
| - name: Build and install mockeagain | ||
| run: | | ||
| cd mockeagain/ && make CC=gcc -j${{ env.JOBS }} && cd .. | ||
| - name: Build and configure nginx | ||
| run: | | ||
| export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH | ||
| export LD_PRELOAD=$PWD/mockeagain/mockeagain.so | ||
| export LD_LIBRARY_PATH=$PWD/mockeagain:$LD_LIBRARY_PATH | ||
| export TEST_NGINX_RESOLVER=8.8.4.4 | ||
| export NGX_BUILD_CC=gcc | ||
| wget http://nginx.org/download/nginx-${{ env.NGINX_VERSION }}.tar.gz | ||
| ngx-build ${{ env.NGINX_VERSION }} --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-cc-opt="-I${{ env.OPENSSL_INC }}" --with-ld-opt="-L${{ env.OPENSSL_LIB }} -Wl,-rpath,${{ env.OPENSSL_LIB }}" --add-module=../ndk-nginx-module --add-module=../lua-nginx-module --with-debug | ||
| nginx -V | ||
| ldd `which nginx`|grep -E 'luajit|ssl|pcre' | ||
| - name: Run tests | ||
| run: | | ||
| export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH | ||
| export LD_PRELOAD=$PWD/mockeagain/mockeagain.so | ||
| export LD_LIBRARY_PATH=$PWD/mockeagain:$LD_LIBRARY_PATH | ||
| export TEST_NGINX_RESOLVER=8.8.4.4 | ||
| prove -r t | ||