Skip to content

Commit

Permalink
Merge pull request #1 from thibaultcha/chore/travis-ci
Browse files Browse the repository at this point in the history
chore(ci) enable Travis CI
  • Loading branch information
thibaultcha authored Apr 22, 2017
2 parents 3d9e432 + 47e70e6 commit 239e7c5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
sudo: false

language: c

compiler: gcc

notifications:
email: false

cache:
directories:
- download-cache
- perl5

env:
global:
- JOBS=2
matrix:
- OPENRESTY_VER=1.11.2.2
- OPENRESTY_VER=1.11.2.3

install:
- mkdir -p download-cache
- if [ ! -f download-cache/openresty-$OPENRESTY_VER ]; then wget -O download-cache/openresty-$OPENRESTY_VER.tar.gz https://openresty.org/download/openresty-$OPENRESTY_VER.tar.gz; fi
- if [ ! -f download-cache/cpanm ]; then wget -O download-cache/cpanm https://cpanmin.us/; fi
- chmod +x download-cache/cpanm
- download-cache/cpanm --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1)
- download-cache/cpanm --local-lib=$TRAVIS_BUILD_DIR/perl5 local::lib && eval $(perl -I $TRAVIS_BUILD_DIR/perl5/lib/perl5/ -Mlocal::lib)
- tar -zxf download-cache/openresty-$OPENRESTY_VER.tar.gz
- pushd openresty-$OPENRESTY_VER
- ./configure --prefix=$TRAVIS_BUILD_DIR/openresty-$OPENRESTY_VER --without-http_ssl_module -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
- export PATH=$TRAVIS_BUILD_DIR/openresty-$OPENRESTY_VER/nginx/sbin:$PATH
- nginx -V

script: prove -r t
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# lua-resty-mlcache

[![Build Status][badge-travis-image]][badge-travis-url]

Fast multi-level key/value cache for OpenResty.

- Can cache scalar Lua types and tables.
Expand Down Expand Up @@ -115,3 +117,6 @@ Work licensed under the MIT License.

[lua-resty-lock]: https://github.com/openresty/lua-resty-lock
[lua-resty-lrucache]: https://github.com/openresty/lua-resty-lrucache

[badge-travis-url]: https://travis-ci.org/thibaultcha/lua-resty-mlcache
[badge-travis-image]: https://travis-ci.org/thibaultcha/lua-resty-mlcache.svg?branch=master
12 changes: 8 additions & 4 deletions t/02-get.t
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,21 @@ hello world
end
local str = ngx.shared.cache:get("key")
ngx.say("in shm: ", str)
local json = cjson.encode(data)
ngx.say("returned table: ", json)
ngx.say("LRU == shm: ", str == json)
ngx.say("hello: ", data.hello)
ngx.say("subt.foo: ", data.subt.foo)
}
}
--- request
GET /t
--- response_body
in shm: {"subt":{"foo":"bar"},"hello":"world"}
returned table: {"subt":{"foo":"bar"},"hello":"world"}
LRU == shm: true
hello: world
subt.foo: bar
--- no_error_log
[error]

Expand Down

0 comments on commit 239e7c5

Please sign in to comment.