forked from Kong/lua-resty-healthcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (50 loc) · 2.3 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
57
58
sudo: required
language: c
compiler: gcc
notifications:
email: false
cache:
directories:
- download-cache
- perl5
env:
global:
- JOBS=2
- LUAROCKS_VER=2.4.3
matrix:
- OPENRESTY_VER=1.11.2.2
- OPENRESTY_VER=1.11.2.4
- OPENRESTY_VER=1.15.8.1
# - LINT=1
install:
- sudo apt-get update
- sudo apt-get install -y libssl-dev ssl-cert
- mkdir -p download-cache
- if [ -z "$OPENRESTY_VER" ]; then export OPENRESTY_VER=1.11.2.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
- tar -zxf download-cache/openresty-$OPENRESTY_VER.tar.gz
- tar -zxf download-cache/luarocks-$LUAROCKS_VER.tar.gz
- 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)
- pushd openresty-$OPENRESTY_VER
- export OPENRESTY_PREFIX=$TRAVIS_BUILD_DIR/openresty-$OPENRESTY_VER
- ./configure --prefix=$OPENRESTY_PREFIX -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:$LUAROCKS_PREFIX/bin:$PATH
- sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)
- sudo luarocks install lua-resty-worker-events > build.log 2>&1 || (cat build.log && exit 1)
- luarocks --version
- nginx -V
script:
- if [ -z "$LINT" ]; then TEST_NGINX_RANDOMIZE=1 prove -j$JOBS -r t; else luacheck lib; fi