-
Notifications
You must be signed in to change notification settings - Fork 237
/
.travis.yml
102 lines (90 loc) · 3.99 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
dist: focal
branches:
only:
- "master"
os: linux
services:
- docker
language: c
compiler:
- gcc
addons:
apt:
packages:
- ack
- axel
- cpanminus
- libtest-base-perl
- libtext-diff-perl
- liburi-perl
- libwww-perl
- libtest-longstring-perl
- liblist-moreutils-perl
- libgd-dev
- time
- cmake
- curl
before_cache:
- docker save -o docker_images/images.tar $(docker images -a -q)
cache:
apt: true
directories:
- download-cache
- docker_images
env:
global:
- JOBS=3
- NGX_BUILD_JOBS=$JOBS
- LUAJIT_PREFIX=/opt/luajit21
- LUAJIT_LIB=$LUAJIT_PREFIX/lib
- LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1
- LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
- TEST_NGINX_MYSQL_PATH=/var/run/mysqld/mysqld.sock
- TEST_NGINX_SLEEP=0.006
- OPENSSL_PREFIX=/opt/ssl
- OPENSSL_LIB=$OPENSSL_PREFIX/lib
- OPENSSL_INC=$OPENSSL_PREFIX/include
- OPENSSL_VER=1.1.1w
jobs:
- NGINX_VERSION=1.27.1 DB_VERSION=mysql:5.7
- NGINX_VERSION=1.27.1 DB_VERSION=mysql:8.0
- NGINX_VERSION=1.27.1 DB_VERSION=mariadb:5.5
- NGINX_VERSION=1.27.1 DB_VERSION=mariadb:10.0
- NGINX_VERSION=1.27.1 DB_VERSION=mariadb:10.1
- NGINX_VERSION=1.27.1 DB_VERSION=mariadb:10.2
- NGINX_VERSION=1.27.1 DB_VERSION=mariadb:10.3
install:
- if [ ! -d download-cache ]; then mkdir download-cache; fi
- if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -O download-cache/openssl-$OPENSSL_VER.tar.gz https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz; fi
- git clone https://github.com/openresty/test-nginx.git
- 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-cjson.git
- git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
- git clone https://github.com/openresty/stream-lua-nginx-module.git ../stream-lua-nginx-module
- git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core
- git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache
- git clone https://github.com/openresty/lua-resty-string.git ../lua-resty-string
- git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
- git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git luajit2
- git clone https://github.com/spacewander/lua-resty-rsa.git ../lua-resty-rsa
before_script:
- docker load -i docker_images/images.tar || true
- sudo systemctl stop mysql
- ./.travis/initializedb.sh
- cd luajit2/
- make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)
- cd ..
script:
- tar zxf download-cache/openssl-$OPENSSL_VER.tar.gz
- cd openssl-$OPENSSL_VER/
- ./config shared --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1)
- make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1)
- sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1) && cd ..
- (cpanm --notest ./test-nginx > build.log 2>&1 || (cat build.log && exit 1))
- cd lua-cjson && (LUA_INCLUDE_DIR=$LUAJIT_INC make && sudo PATH=$PATH make install) || (cat build.log && exit 1) && cd ..
- export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH
- ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-cc-opt="-I$OPENSSL_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB" --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --add-module=../lua-nginx-module --add-module=../stream-lua-nginx-module --with-debug > build.log 2>&1 || (cat build.log && exit 1)
- TEST_SUBSYSTEM=http prove -I. -I./test-nginx/inc -I./test-nginx/lib -r t
- TEST_SUBSYSTEM=stream prove -I. -I./test-nginx/inc -I./test-nginx/lib -r t