-
Notifications
You must be signed in to change notification settings - Fork 123
/
.travis.yml
94 lines (85 loc) · 3.41 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
language: python
sudo: false
addons:
apt:
packages:
- libmysqlclient-dev
- libpq-dev
- libsqlite3-dev
services:
- mysql
- postgresql
env:
# Lua 5.1 on different DBs
- LUA="lua 5.1" DB_DRIVER=mysql DB_USER=travis DB_NAME=sailor_test
- LUA="lua 5.1" DB_DRIVER=postgres DB_USER=postgres DB_NAME=sailor_test
- LUA="lua 5.1" DB_DRIVER=sqlite3 DB_USER="" DB_NAME=$TRAVIS_BUILD_DIR/sailor_test
# Lua 5.2 on different DBs
- LUA="lua 5.2" DB_DRIVER=mysql DB_USER=travis DB_NAME=sailor_test
- LUA="lua 5.2" DB_DRIVER=postgres DB_USER=postgres DB_NAME=sailor_test
- LUA="lua 5.2" DB_DRIVER=sqlite3 DB_USER="" DB_NAME=$TRAVIS_BUILD_DIR/sailor_test
# Lua 5.3 on different DBs
- LUA="lua 5.3" DB_DRIVER=mysql DB_USER=travis DB_NAME=sailor_test
- LUA="lua 5.3" DB_DRIVER=postgres DB_USER=postgres DB_NAME=sailor_test
- LUA="lua 5.3" DB_DRIVER=sqlite3 DB_USER="" DB_NAME=$TRAVIS_BUILD_DIR/sailor_test
# LuaJIT 2.0.x on different DBs
- LUA="luajit 2.0" DB_DRIVER=mysql DB_USER=travis DB_NAME=sailor_test
- LUA="luajit 2.0" DB_DRIVER=postgres DB_USER=postgres DB_NAME=sailor_test
- LUA="luajit 2.0" DB_DRIVER=sqlite3 DB_USER="" DB_NAME=$TRAVIS_BUILD_DIR/sailor_test
# Openresty + LuaJIT 2.1.x + mysql
- LUA="luajit 2.1" DB_DRIVER=mysql DB_USER=travis DB_NAME=sailor_test SERVER=openresty
before_install:
- pip install hererocks
- hererocks HERE --$LUA --no-readline --luarocks latest --verbose
- hererocks HERE --show
- source HERE/bin/activate
install:
- luarocks install luacheck
- luarocks install luacov
- luarocks install luacov-coveralls
- luarocks make rockspecs/sailor-current-1.rockspec
- if [ "$DB_DRIVER" == "mysql" ]; then luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql; fi
- if [ "$DB_DRIVER" == "postgres" ]; then luarocks install luasql-postgres PGSQL_INCDIR=/usr/include/postgresql; fi
- if [ "$DB_DRIVER" == "sqlite3" ]; then luarocks install luasql-sqlite3; fi
- luarocks list
- |
if [ "$SERVER" == "openresty" ]; then
OPENRESTY_VERSION="1.11.2.5"
wget https://openresty.org/download/openresty-$OPENRESTY_VERSION.tar.gz
tar xzf openresty-$OPENRESTY_VERSION.tar.gz
cd openresty-$OPENRESTY_VERSION/
ln -s $TRAVIS_BUILD_DIR/HERE/include $TRAVIS_BUILD_DIR/HERE/include/luajit-2.1
./configure --prefix=$TRAVIS_BUILD_DIR/HERE --with-luajit=$TRAVIS_BUILD_DIR/HERE
make
make install
ln -s $TRAVIS_BUILD_DIR/HERE/nginx/sbin/nginx $TRAVIS_BUILD_DIR/HERE/bin/nginx
cd ..
rm -rf openresty-$OPENRESTY_VERSION
nginx -v
resty -V
fi
before_script:
- mysql -e 'create database sailor_test;'
- mysql sailor_test < test/dev-app/sql/mysql.sql
- psql -c 'create database sailor_test;' -U postgres
- psql sailor_test < test/dev-app/sql/pgsql.sql
- sqlite3 $TRAVIS_BUILD_DIR/sailor_test < test/dev-app/sql/sqlite3.sql
script:
- luacheck src test
- |
cd test/dev-app
if [ "$SERVER" != "openresty" ]; then
sailor test -- --verbose --coverage
else
sailor test --resty
fi
after_success: |
if [ "$SERVER" != "openresty" ]; then
mv luacov.stats.out ../..
cd ../..
luacov-coveralls -c test/dev-app/.luacov
fi
notifications:
email:
on_success: change
on_failure: always