Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
[travis] fix travis integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed Apr 6, 2016
1 parent 77d70e4 commit f9bfb20
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
rockspecs/*.src.rock
luacov.*.out
43 changes: 19 additions & 24 deletions .travis.yml
@@ -1,35 +1,30 @@
language: erlang
language: python
sudo: false

env:
global:
- LUAROCKS_BASE=luarocks-2.1.0
matrix:
- LUA=lua5.1 LUA_DEV=liblua5.1-dev LUA_VER=5.1 LUA_SFX=5.1 LUA_INCDIR=/usr/include/lua5.1
- LUA=lua5.2 LUA_DEV=liblua5.2-dev LUA_VER=5.2 LUA_SFX=5.2 LUA_INCDIR=/usr/include/lua5.2
- LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0
- LUA="lua=5.1"
- LUA="lua=5.2"
- LUA="lua=5.3"
- LUA="luajit=2.0"
- LUA="luajit=2.1"

before_install:
- if [ $LUA = "luajit" ]; then
sudo add-apt-repository ppa:mwild1/ppa -y && sudo apt-get update -y;
fi
- sudo apt-get install $LUA
- sudo apt-get install $LUA_DEV
- lua$LUA_SFX -v
# Install a recent luarocks release
- wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz
- tar zxvpf $LUAROCKS_BASE.tar.gz
- cd $LUAROCKS_BASE
- ./configure
--lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR"
- sudo make
- sudo make install
- cd $TRAVIS_BUILD_DIR
- pip install hererocks
- hererocks lua_install -r^ --$LUA
- export PATH=$PATH:$PWD/lua_install/bin # Add directory with all installed binaries to PATH

install:
- sudo -E luarocks install busted 1.11.1-1
- luarocks install luacheck
- luarocks install busted
- luarocks install luacov
- luarocks install luacov-coveralls

script:
- sudo -E busted -v
- luacheck --std max+busted *.lua spec
- busted --verbose --coverage --lpath=./?.lua

after_success:
- luacov-coveralls --exclude $TRAVIS_BUILD_DIR/lua_install

notifications:
email:
Expand Down
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -143,6 +143,24 @@ http {

Read more about it in https://docs.apitools.com/blog/2014/04/24/a-small-router-for-openresty.html

Testing
=======

Install dependencies:

```shell
luarocks install luacheck
luarocks install busted
luarocks install luacov
luarocks install luacov-coveralls
```

And run tests:

```shell
luacheck --std max+busted *.lua spec
busted --verbose --coverage --lpath=./?.lua
```

License
=======
Expand Down

0 comments on commit f9bfb20

Please sign in to comment.