sudo: required
dist: trusty

os: linux

language: c

compiler:
  - gcc

env:
  global:
    - LUAJIT_LIB=/usr/lib64/libluajit-5.1.so
    - LUAJIT_INC=/usr/include/luajit-2.0
    - LUA_INCLUDE_DIR=/usr/include/luajit-2.0
    - LUA_CMODULE_DIR=/lib
  matrix:
    - NGINX_VERSION=1.9.15

before_install:
  - sudo apt-get install -y axel cpanminus libluajit-5.1-dev
  - sudo cpanm --notest Test::Base IPC::Run

install:
  - git clone https://github.com/openresty/openresty.git ../openresty
  - git clone https://github.com/openresty/nginx-devel-utils.git
  - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
  - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx

script:
  - export PATH=$PATH:`pwd`/nginx-devel-utils
  - ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --add-module=../lua-nginx-module --with-debug
  - export PATH=$PATH:`pwd`/work/nginx/sbin
  - prove -lv t/resty
