forked from Kong/lua-resty-dns-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (49 loc) · 2.22 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
sudo: required
language: c
compiler: gcc
notifications:
email: false
cache:
directories:
- download-cache
- perl5
env:
global:
- JOBS=2
- LUAROCKS_VER=3.3.0
matrix:
- OPENRESTY_VER=1.15.8.3
- OPENRESTY_VER=1.17.8.2
install:
- mkdir -p download-cache
- if [ -z "$OPENRESTY_VER" ]; then export OPENRESTY_VER=1.15.8.3; fi
- if [ ! -f download-cache/openresty-$OPENRESTY_VER.tar.gz ]; then wget -O download-cache/openresty-$OPENRESTY_VER.tar.gz http://openresty.org/download/openresty-$OPENRESTY_VER.tar.gz; fi
- if [ ! -f download-cache/luarocks-$LUAROCKS_VER.tar.gz ]; then wget -O download-cache/luarocks-$LUAROCKS_VER.tar.gz https://luarocks.github.io/luarocks/releases/luarocks-$LUAROCKS_VER.tar.gz; fi
- if [ ! -f download-cache/cpanm ]; then wget -O download-cache/cpanm https://cpanmin.us/; fi
- chmod +x download-cache/cpanm
- download-cache/cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1)
- download-cache/cpanm --notest --local-lib=$TRAVIS_BUILD_DIR/perl5 local::lib && eval $(perl -I $TRAVIS_BUILD_DIR/perl5/lib/perl5/ -Mlocal::lib)
- tar -zxf download-cache/openresty-$OPENRESTY_VER.tar.gz
- tar -zxf download-cache/luarocks-$LUAROCKS_VER.tar.gz
- pushd openresty-$OPENRESTY_VER
- export OPENRESTY_PREFIX=$TRAVIS_BUILD_DIR/openresty-$OPENRESTY_VER
- ./configure --prefix=$OPENRESTY_PREFIX --without-http_ssl_module -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- make install > build.log 2>&1 || (cat build.log && exit 1)
- popd
- pushd luarocks-$LUAROCKS_VER
- export LUAROCKS_PREFIX=$TRAVIS_BUILD_DIR/luarocks-$LUAROCKS_VER
- ./configure --with-lua=$OPENRESTY_PREFIX/luajit --with-lua-include=$OPENRESTY_PREFIX/luajit/include/luajit-2.1 --lua-suffix=jit
- make build
- sudo make install
- popd
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/bin:$LUAROCKS_PREFIX/bin:$PATH
- sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)
- sudo luarocks install busted > build.log 2>&1 || (cat build.log && exit 1)
- sudo luarocks make
- luarocks --version
- nginx -V
script:
- luacheck ./src
- busted
- TEST_NGINX_RANDOMIZE=1 prove -v -r t