Skip to content

more fixes

more fixes #2

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 20, Col: 23): Unrecognized named-value: 'env'. Located at position 1 within expression: env.JOBS, (Line: 22, Col: 19): Unrecognized named-value: 'env'. Located at position 1 within expression: env.LUAJIT_PREFIX, (Line: 23, Col: 19): Unrecognized named-value: 'env'. Located at position 1 within expression: env.LUAJIT_PREFIX, (Line: 24, Col: 24): Unrecognized named-value: 'env'. Located at position 1 within expression: env.LUAJIT_INC, (Line: 27, Col: 20): Unrecognized named-value: 'env'. Located at position 1 within expression: env.OPENSSL_PREFIX, (Line: 28, Col: 20): Unrecognized named-value: 'env'. Located at position 1 within expression: env.OPENSSL_PREFIX, (Line: 29, Col: 24): Unrecognized named-value: 'env'. Located at position 1 within expression: env.LUAJIT_LIB
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