|
| 1 | +sudo: required |
| 2 | +dist: trusty |
| 3 | + |
| 4 | +os: linux |
| 5 | + |
| 6 | +language: c |
| 7 | + |
| 8 | +compiler: |
| 9 | + - gcc |
| 10 | + - clang |
| 11 | + |
| 12 | +cache: |
| 13 | + directories: |
| 14 | + - download-cache |
| 15 | + |
| 16 | +env: |
| 17 | + global: |
| 18 | + - JOBS=3 |
| 19 | + - NGX_BUILD_JOBS=$JOBS |
| 20 | + - LUAJIT_PREFIX=/opt/luajit21 |
| 21 | + - LUAJIT_LIB=$LUAJIT_PREFIX/lib |
| 22 | + - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 |
| 23 | + - LUA_INCLUDE_DIR=$LUAJIT_INC |
| 24 | + - LUA_CMODULE_DIR=/lib |
| 25 | + - OPENSSL_PREFIX=/opt/ssl |
| 26 | + - OPENSSL_LIB=$OPENSSL_PREFIX/lib |
| 27 | + - OPENSSL_INC=$OPENSSL_PREFIX/include |
| 28 | + - OPENSSL_VER=1.0.2h |
| 29 | + - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH |
| 30 | + - TEST_NGINX_SLEEP=0.006 |
| 31 | + matrix: |
| 32 | + - NGINX_VERSION=1.9.15 |
| 33 | + - NGINX_VERSION=1.11.2 |
| 34 | + |
| 35 | +install: |
| 36 | + - if [ ! -d download-cache ]; then mkdir download-cache; fi |
| 37 | + - if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -O download-cache/openssl-$OPENSSL_VER.tar.gz https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz; fi |
| 38 | + - sudo apt-get install -qq -y cpanminus axel |
| 39 | + - sudo cpanm --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1) |
| 40 | + - wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz |
| 41 | + - git clone https://github.com/openresty/openresty.git ../openresty |
| 42 | + - git clone https://github.com/openresty/nginx-devel-utils.git |
| 43 | + - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module |
| 44 | + - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module |
| 45 | + - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx |
| 46 | + - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git |
| 47 | + - git clone https://github.com/openresty/mockeagain.git |
| 48 | + |
| 49 | +script: |
| 50 | + - cd luajit2/ |
| 51 | + - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) |
| 52 | + - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) |
| 53 | + - cd .. |
| 54 | + - tar zxf download-cache/openssl-$OPENSSL_VER.tar.gz |
| 55 | + - cd openssl-$OPENSSL_VER/ |
| 56 | + - ./config shared --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1) |
| 57 | + - make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1) |
| 58 | + - sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1) |
| 59 | + - cd ../mockeagain/ && make CC=$CC -j$JOBS && cd .. |
| 60 | + - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH |
| 61 | + - export LD_PRELOAD=$PWD/mockeagain/mockeagain.so |
| 62 | + - export LD_LIBRARY_PATH=$PWD/mockeagain:$LD_LIBRARY_PATH |
| 63 | + - export TEST_NGINX_RESOLVER=8.8.4.4 |
| 64 | + - export NGX_BUILD_CC=$CC |
| 65 | + - ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-cc-opt="-I$OPENSSL_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB" --add-module=../ndk-nginx-module --add-module=../lua-nginx-module --with-debug > build.log 2>&1 || (cat build.log && exit 1) |
| 66 | + - nginx -V |
| 67 | + - ldd `which nginx`|grep -E 'luajit|ssl|pcre' |
| 68 | + - prove -r t |
0 commit comments