Skip to content

Commit f03e1ff

Browse files
chipitsineagentzh
authored andcommitted
feature: added travis-ci support.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
1 parent c384479 commit f03e1ff

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.travis.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
- LUAJIT_PREFIX=/opt/luajit21
19+
- LUAJIT_LIB=$LUAJIT_PREFIX/lib
20+
- LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
21+
- LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1
22+
- LUA_INCLUDE_DIR=$LUAJIT_INC
23+
- LUA_CMODULE_DIR=/lib
24+
- PCRE_VER=8.33
25+
- PCRE_PREFIX=/opt/pcre
26+
- PCRE_LIB=$PCRE_PREFIX/lib
27+
- PCRE_INC=$PCRE_PREFIX/include
28+
- JOBS=3
29+
- NGX_BUILD_JOBS=$JOBS
30+
matrix:
31+
- NGINX_VERSION=1.9.15
32+
33+
services:
34+
- memcache
35+
- redis-server
36+
37+
before_install:
38+
- sudo apt-get install -qq -y axel cpanminus libgd-dev libtest-base-perl libtext-diff-perl liburi-perl libwww-perl libtest-longstring-perl liblist-moreutils-perl > build.log 2>&1 || (cat build.log && exit 1)
39+
40+
install:
41+
- if [ ! -d download-cache ]; then mkdir download-cache; fi
42+
- if [ ! -f download-cache/pcre-$PCRE_VER.tar.gz ]; then wget -O download-cache/pcre-$PCRE_VER.tar.gz http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-$PCRE_VER.tar.gz; fi
43+
- git clone https://github.com/openresty/nginx-devel-utils.git
44+
- git clone https://github.com/openresty/lua-cjson.git
45+
- git clone https://github.com/openresty/openresty.git ../openresty
46+
- git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
47+
- git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module
48+
- git clone https://github.com/openresty/mockeagain.git
49+
- git clone https://github.com/openresty/test-nginx.git
50+
- git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git
51+
- git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
52+
- git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module
53+
- git clone https://github.com/openresty/memc-nginx-module.git ../memc-nginx-module
54+
- git clone https://github.com/openresty/headers-more-nginx-module.git ../headers-more-nginx-module
55+
- git clone https://github.com/openresty/stream-echo-nginx-module.git ../stream-echo-nginx-module
56+
57+
script:
58+
- tar zxf download-cache/pcre-$PCRE_VER.tar.gz
59+
- cd pcre-$PCRE_VER/
60+
- ./configure --prefix=$PCRE_PREFIX --enable-jit --enable-utf --enable-unicode-properties > build.log 2>&1 || (cat build.log && exit 1)
61+
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
62+
- sudo PATH=$PATH make install > build.log 2>&1 || (cat build.log && exit 1)
63+
- cd ..
64+
- cd luajit2
65+
- 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)
66+
- sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)
67+
- cd ../test-nginx && sudo cpanm . && cd ..
68+
- cd lua-cjson/ && make -j$JOBS && sudo make install && cd ..
69+
- cd mockeagain/ && make CC=$CC -j$JOBS && cd ..
70+
- export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH
71+
- export NGX_BUILD_CC=$CC
72+
- sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1)
73+
- nginx -V
74+
- ldd `which nginx`|grep luajit
75+
- export LD_PRELOAD=$PWD/mockeagain/mockeagain.so
76+
- prove -r t

0 commit comments

Comments
 (0)