-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path.travis.yml
59 lines (51 loc) · 2.2 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
59
# vim:set sts=2 ts=2 sw=2 et:
os: linux
dist: xenial
sudo: false
language: c
notifications:
email: false
cache:
directories:
- download-cache
- perl5
env:
global:
- JOBS=2
- LUAROCKS=3.2.1
- TEST_NGINX_TIMEOUT=6
matrix:
- OPENRESTY=1.15.8.2
before_install:
- mkdir -p download-cache
- if [ ! -f download-cache/openresty-$OPENRESTY.tar.gz ]; then wget -O download-cache/openresty-$OPENRESTY.tar.gz https://openresty.org/download/openresty-$OPENRESTY.tar.gz; fi
- if [ ! -f download-cache/luarocks-$LUAROCKS.tar.gz ]; then wget -O download-cache/luarocks-$LUAROCKS.tar.gz https://luarocks.github.io/luarocks/releases/luarocks-$LUAROCKS.tar.gz; fi
- if [ ! -f download-cache/cpanm ]; then wget -O download-cache/cpanm https://cpanmin.us/; fi
- tar -zxf download-cache/openresty-$OPENRESTY.tar.gz
- tar -zxf download-cache/luarocks-$LUAROCKS.tar.gz
install:
- 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
- export OPENRESTY_PREFIX=$TRAVIS_BUILD_DIR/openresty-$OPENRESTY
- ./configure --prefix=$OPENRESTY_PREFIX --without-http_ssl_module --with-pcre-jit -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
- export LUAROCKS_PREFIX=$TRAVIS_BUILD_DIR/luarocks-$LUAROCKS
- ./configure --prefix=$LUAROCKS_PREFIX --with-lua=$OPENRESTY_PREFIX/luajit --with-lua-include=$OPENRESTY_PREFIX/luajit/include/luajit-2.1 --lua-suffix=jit >build.log 2>&1 || (cat build.log && exit 1)
- make build >build.log 2>&1 || (cat build.log && exit 1)
- make install >build.log 2>&1 || (cat build.log && exit 1)
- popd
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$LUAROCKS_PREFIX/bin:$PATH
- eval `luarocks path`
- luarocks install luacheck
- luarocks install luacov-coveralls
- luarocks install Lua-cURL
- nginx -V
script:
- make lint
- make coverage
- luacov-coveralls -v -i %./lib