mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Travis update
The new container-based format doesn't do sudo anymore, so there are some extensive changes. It does, however, allow cache. I also took the opportunity to switch to a newer busted. The root element for that now needs to be a table.
This commit is contained in:
2
.busted
2
.busted
@@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
default = {
|
default = {
|
||||||
verbose = true,
|
verbose = true,
|
||||||
ROOT = "spec/front/unit",
|
ROOT = {"spec/front/unit"},
|
||||||
lpath = "spec/front/unit/?.lua",
|
lpath = "spec/front/unit/?.lua",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
72
.travis.yml
72
.travis.yml
@@ -3,35 +3,65 @@
|
|||||||
|
|
||||||
language: c
|
language: c
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
- gcc
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- EMULATE_READER=1 USE_NO_CCACHE=1
|
- EMULATE_READER=1
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.ccache
|
||||||
|
# - base
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
- libsdl1.2-dev
|
||||||
|
- luarocks
|
||||||
|
# for luasec
|
||||||
|
- libssl1.0.0
|
||||||
|
- nasm
|
||||||
|
# OpenSSL likes this (package contains makedepend)
|
||||||
|
- xutils-dev
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
# don't do this for clang
|
||||||
- sudo apt-get update -qq
|
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||||
- sudo apt-get install -qq g++-4.8
|
# in case anything ignores the environment variables, override through PATH
|
||||||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
|
- mkdir bin
|
||||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
|
- ln -s $(which gcc-4.8) bin/cc
|
||||||
|
- ln -s $(which gcc-4.8) bin/gcc
|
||||||
|
- ln -s $(which c++-4.8) bin/c++
|
||||||
|
- ln -s $(which g++-4.8) bin/g++
|
||||||
|
- export PATH=$PWD/bin:$PATH
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# nasm for building libpng
|
- mkdir $HOME/.luarocks
|
||||||
- sudo apt-get install libsdl1.2-dev luarocks nasm
|
- cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua
|
||||||
# install an older version of lua_cliargs for busted v1.10.0
|
- echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
|
||||||
- sudo luarocks install lua_cliargs 2.1-2
|
- travis_retry luarocks --local install lua_cliargs
|
||||||
# recent versions of busted may cause some weird segmentation faults
|
# versions older than 1.10ish and <2.0.rc10-0ish of busted may cause some weird segmentation faults
|
||||||
- travis_retry git clone https://github.com/Olivine-Labs/busted/
|
- travis_retry git clone https://github.com/Olivine-Labs/busted/
|
||||||
- cd busted && git checkout v1.10.0 && sudo luarocks make && cd ..
|
- cd busted && git checkout v2.0.rc10-0 && luarocks --local make busted-2.0.rc10-0.rockspec && cd ..
|
||||||
- travis_retry sudo luarocks install luacov
|
- travis_retry luarocks --local install luacov
|
||||||
- travis_retry sudo luarocks install luacov-coveralls --server=http://rocks.moonscript.org/dev
|
# luasec doesn't automatically detect 64-bit libs
|
||||||
|
- travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
|
||||||
|
- travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
|
||||||
|
# add local rocks to $PATH
|
||||||
|
# on newer luarocks, `luarocks path --bin` would suffice because it includes the PATH now
|
||||||
|
- eval $(luarocks path --bin)
|
||||||
|
- export PATH=$PATH:$HOME/.luarocks/bin
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- travis_retry make fetchthirdparty all
|
- travis_retry make fetchthirdparty all
|
||||||
- sudo cp base/build/*/luajit /usr/bin/
|
- travis_retry make testfront
|
||||||
- make testfront
|
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- make coverage
|
- make coverage
|
||||||
- cd koreader-*/koreader && luacov-coveralls -v
|
- cd koreader-*/koreader && luacov-coveralls -v
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -93,14 +93,14 @@ $(INSTALL_DIR)/koreader/.luacov:
|
|||||||
ln -sf ../../.luacov $(INSTALL_DIR)/koreader
|
ln -sf ../../.luacov $(INSTALL_DIR)/koreader
|
||||||
|
|
||||||
testfront: $(INSTALL_DIR)/koreader/.busted
|
testfront: $(INSTALL_DIR)/koreader/.busted
|
||||||
cd $(INSTALL_DIR)/koreader && busted -l ./luajit --exclude-tags=notest
|
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) --exclude-tags=notest
|
||||||
|
|
||||||
test:
|
test:
|
||||||
$(MAKE) -C $(KOR_BASE) test
|
$(MAKE) -C $(KOR_BASE) test
|
||||||
$(MAKE) testfront
|
$(MAKE) testfront
|
||||||
|
|
||||||
coverage: $(INSTALL_DIR)/koreader/.luacov
|
coverage: $(INSTALL_DIR)/koreader/.luacov
|
||||||
cd $(INSTALL_DIR)/koreader && busted -c -l ./luajit --exclude-tags=nocov
|
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) --coverage --exclude-tags=nocov
|
||||||
# coverage report summary
|
# coverage report summary
|
||||||
cd $(INSTALL_DIR)/koreader && tail -n \
|
cd $(INSTALL_DIR)/koreader && tail -n \
|
||||||
+$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \
|
+$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \
|
||||||
|
|||||||
Reference in New Issue
Block a user