Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wujunze committed Jun 29, 2019
1 parent 663d283 commit 1d36f6e
Showing 1 changed file with 37 additions and 19 deletions.
56 changes: 37 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
sudo: required
dist: trusty

os: linux
dist: xenial

language: c

compiler:
- gcc
- clang
sudo: required

addons:
apt:
packages:
- luarocks
- jq

- cpanminus
- build-essential
- libncurses5-dev
- libpcre3-dev
- libreadline-dev
- libssl-dev
- perl
- etcd
- luarocks
- cmake
- lua-check

env:
matrix:
- NGINX_VERSION=1.9.15
- NGINX_VERSION=1.11.2
global:
- OPENRESTY_PREFIX=/usr/local/openresty-debug

before_install:
- jq . conf/orange.conf.example >> /dev/null || exit 1
- sudo luarocks install luacheck
- luacheck -q .
- '! grep -n -P ''(?<=.{80}).+'' --color `find . -name ''*.lua''` || (echo "ERROR: Found Lua source lines exceeding 80 columns." > /dev/stderr; exit 1)'
- '! grep -n -P ''\t+'' --color `find . -name ''*.lua''` || (echo "ERROR: Cannot use tabs." > /dev/stderr; exit 1)'
- sudo cpanm --notest Test::Nginx IPC::Run > build.log 2>&1 || (cat build.log && exit 1)

install:
- wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
- sudo apt-get update
- sudo apt-get install openresty-debug
- sudo opm --install-dir=./ get zhangbao0325/orangelib
- sudo luarocks install luafilesystem
- sudo luarocks install luasocket
- sudo cd cd conf
- sudo cp orange.conf.example orange.conf
- sudo cp nginx.conf.example nginx.conf
- git clone https://github.com/openresty/test-nginx.git test-nginx

script:
- sudo service etcd start
- sudo orange start
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$PATH
- make check || exit 1
- prove -Itest-nginx/lib -r t

0 comments on commit 1d36f6e

Please sign in to comment.