aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Perrad <francois.perrad@gadz.org>2017-09-18 19:07:46 +0200
committerFrancois Perrad <francois.perrad@gadz.org>2017-09-20 20:36:25 +0200
commit67184dd83a2f9bdd64d237bf39210bcca7d5bb72 (patch)
treedc318c0a7cb3e31c958ff65a42a810234ee65913
parent9ee17b7134b88c01e7efe33a982c4b5b8234b86a (diff)
downloadvalua-67184dd83a2f9bdd64d237bf39210bcca7d5bb72.tar.gz
valua-67184dd83a2f9bdd64d237bf39210bcca7d5bb72.tar.bz2
valua-67184dd83a2f9bdd64d237bf39210bcca7d5bb72.zip
refactor travis with hererocks
see <https://github.com/mpeterv/hererocks>
-rw-r--r--.travis.yml30
-rw-r--r--.travis/platform.sh15
-rw-r--r--.travis/setenv_lua.sh3
-rw-r--r--.travis/setup_lua.sh122
4 files changed, 18 insertions, 152 deletions
diff --git a/.travis.yml b/.travis.yml
index 27fe9c5..ffdef71 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,22 +1,28 @@
-language: c
-
+language: python
sudo: false
env:
- global:
- - LUAROCKS=2.2.1
- matrix:
- - LUA=lua5.1
- - LUA=lua5.2
- - LUA=lua5.3
- - LUA=luajit # latest stable version (2.0.3)
- - LUA=luajit2.0 # current head of 2.0 branch
- #- LUA=luajit2.1 # current head of 2.1 branch
+ - LUA="lua 5.1" COMPAT=default
+ - LUA="lua 5.2" COMPAT=default
+ - LUA="lua 5.2" COMPAT=none
+ - LUA="lua 5.3" COMPAT=default
+ - LUA="lua 5.3" COMPAT=none
+ - LUA="luajit 2.0" COMPAT=none
+ - LUA="luajit 2.0" COMPAT=all
+ - LUA="luajit 2.1" COMPAT=none
+ - LUA="luajit 2.1" COMPAT=all
before_install:
- - source .travis/setenv_lua.sh
+ - pip install hererocks
+ - hererocks HERE --$LUA --compat $COMPAT --no-readline --luarocks latest --verbose
+ - hererocks HERE --show
+ - source HERE/bin/activate
+
+install:
+ - luarocks install luacheck
script:
+ # - luacheck --codes --std=max *.lua
- lua valua-test.lua
after_success:
diff --git a/.travis/platform.sh b/.travis/platform.sh
deleted file mode 100644
index 7259a7d..0000000
--- a/.travis/platform.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-if [ -z "${PLATFORM:-}" ]; then
- PLATFORM=$TRAVIS_OS_NAME;
-fi
-
-if [ "$PLATFORM" == "osx" ]; then
- PLATFORM="macosx";
-fi
-
-if [ -z "$PLATFORM" ]; then
- if [ "$(uname)" == "Linux" ]; then
- PLATFORM="linux";
- else
- PLATFORM="macosx";
- fi;
-fi
diff --git a/.travis/setenv_lua.sh b/.travis/setenv_lua.sh
deleted file mode 100644
index 8d8c825..0000000
--- a/.travis/setenv_lua.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin
-bash .travis/setup_lua.sh
-eval `$HOME/.lua/luarocks path`
diff --git a/.travis/setup_lua.sh b/.travis/setup_lua.sh
deleted file mode 100644
index 8a07c16..0000000
--- a/.travis/setup_lua.sh
+++ /dev/null
@@ -1,122 +0,0 @@
-#! /bin/bash
-
-# A script for setting up environment for travis-ci testing.
-# Sets up Lua and Luarocks.
-# LUA must be "lua5.1", "lua5.2" or "luajit".
-# luajit2.0 - master v2.0
-# luajit2.1 - master v2.1
-
-set -eufo pipefail
-
-LUAJIT_BASE="LuaJIT-2.0.3"
-
-source .travis/platform.sh
-
-LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua
-
-LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks
-
-mkdir $HOME/.lua
-
-LUAJIT="no"
-
-if [ "$PLATFORM" == "macosx" ]; then
- if [ "$LUA" == "luajit" ]; then
- LUAJIT="yes";
- fi
- if [ "$LUA" == "luajit2.0" ]; then
- LUAJIT="yes";
- fi
- if [ "$LUA" == "luajit2.1" ]; then
- LUAJIT="yes";
- fi;
-elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
- LUAJIT="yes";
-fi
-
-mkdir -p "$LUA_HOME_DIR"
-
-if [ "$LUAJIT" == "yes" ]; then
-
- git clone https://github.com/LuaJIT/LuaJIT $LUAJIT_BASE;
-
- cd $LUAJIT_BASE
-
- if [ "$LUA" == "luajit2.1" ]; then
- git checkout v2.1;
- fi
-
- if [ "$LUA" == "luajit" ]; then
- git checkout tags/v2.0.3;
- fi
-
- make && make install PREFIX="$LUA_HOME_DIR"
-
- if [ "$LUA" == "luajit2.1" ]; then
- ln -s $LUA_HOME_DIR/bin/luajit-2.1.0-alpha $HOME/.lua/luajit
- ln -s $LUA_HOME_DIR/bin/luajit-2.1.0-alpha $HOME/.lua/lua;
- else
- ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit
- ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua;
- fi;
-
-else
-
- if [ "$LUA" == "lua5.1" ]; then
- curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
- cd lua-5.1.5;
- elif [ "$LUA" == "lua5.2" ]; then
- curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz
- cd lua-5.2.4;
- elif [ "$LUA" == "lua5.3" ]; then
- curl http://www.lua.org/ftp/lua-5.3.0.tar.gz | tar xz
- cd lua-5.3.0;
- fi
-
- make $PLATFORM
- make INSTALL_TOP="$LUA_HOME_DIR" install;
-
- ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua
- ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac;
-
-fi
-
-cd $TRAVIS_BUILD_DIR
-
-lua -v
-
-LUAROCKS_BASE=luarocks-$LUAROCKS
-
-curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
-
-cd $LUAROCKS_BASE
-
-if [ "$LUA" == "luajit" ]; then
- ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
-elif [ "$LUA" == "luajit2.0" ]; then
- ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
-elif [ "$LUA" == "luajit2.1" ]; then
- ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR";
-else
- ./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR"
-fi
-
-make build && make install
-
-ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks
-
-cd $TRAVIS_BUILD_DIR
-
-luarocks --version
-
-rm -rf $LUAROCKS_BASE
-
-if [ "$LUAJIT" == "yes" ]; then
- rm -rf $LUAJIT_BASE;
-elif [ "$LUA" == "lua5.1" ]; then
- rm -rf lua-5.1.5;
-elif [ "$LUA" == "lua5.2" ]; then
- rm -rf lua-5.2.4;
-elif [ "$LUA" == "lua5.3" ]; then
- rm -rf lua-5.3.0;
-fi