Sitelet https://github.com/lua-stdlib/lua-stdlib/commit/2de7a376e8f63d7cde658cfaf7899b40640517ad
Skip to content

Commit 2de7a37

Browse files
committed
maint: vastly simplified .travis.yml.
* .travis.yml: Use hererocks, and simplify massively. Introduce coverage reporting. * .luacov: Configure coverage reporting. * README.md: Include coverage badge. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
1 parent 0ab996a commit 2de7a37

3 files changed

Lines changed: 73 additions & 124 deletions

File tree

‎.luacov‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
return {
2+
-- filename to store stats collected
3+
["statsfile"] = "luacov.stats.out",
4+
5+
-- filename to store report
6+
["reportfile"] = "luacov.report.out",
7+
8+
-- luacov.stats file updating frequency.
9+
-- The lower this value - the more frequenty results will be written out to luacov.stats
10+
-- You may want to reduce this value for short lived scripts (to for example 2) to avoid losing coverage data.
11+
["savestepsize"] = 100,
12+
13+
-- Run reporter on completion? (won't work for ticks)
14+
runreport = true,
15+
16+
-- Delete stats file after reporting?
17+
deletestats = false,
18+
19+
-- Process Lua code loaded from raw strings
20+
-- (that is, when the 'source' field in the debug info
21+
-- does not start with '@')
22+
codefromstrings = false,
23+
24+
-- Patterns for files to include when reporting
25+
-- all will be included if nothing is listed
26+
-- (exclude overrules include, do not include
27+
-- the .lua extension, path separator is always '/')
28+
["include"] = {
29+
"lib/std/_base$",
30+
"lib/std/debug$",
31+
"lib/std/debug_init/init$",
32+
"lib/std/io$",
33+
"lib/std/math$",
34+
"lib/std/package$",
35+
"lib/std/string$",
36+
"lib/std/table$",
37+
--"lib/std/version$",
38+
},
39+
40+
-- Patterns for files to exclude when reporting
41+
-- all will be included if nothing is listed
42+
-- (exclude overrules include, do not include
43+
-- the .lua extension, path separator is always '/')
44+
["exclude"] = {
45+
"luacov$",
46+
"luacov/reporter$",
47+
"luacov/defaults$",
48+
"luacov/runner$",
49+
"luacov/stats$",
50+
"luacov/tick$",
51+
},
52+
}

‎.travis.yml‎

Lines changed: 20 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,34 @@
1-
language: c
1+
language: python
22

3-
addons:
4-
apt:
5-
packages:
6-
- help2man
3+
sudo: false
74

85
env:
9-
global:
10-
- _VERSION=42.0.0
11-
12-
- LUAJIT_DIR=luajit-2.0
13-
- LUAJIT_VER=2.0.4
14-
- LUA53_VER=5.3.2
15-
- LUAROCKS_VER=2.2.2
16-
17-
- _COMPILE="libtool --mode=compile --tag=CC gcc"
18-
- _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX"
19-
- _INSTALL="libtool --mode=install install -p"
20-
- _LINK="libtool --mode=link --tag=CC gcc"
21-
- _LIBS="-lm -Wl,-E -ldl -lreadline"
22-
23-
- prefix=/usr/local
24-
- bindir=$prefix/bin
25-
- incdir=$prefix/include
26-
- libdir=$prefix/lib
27-
28-
- _inst=$TRAVIS_BUILD_DIR/_inst
29-
- luadir=$_inst/share/lua
30-
- luaexecdir=$_inst/lib/lua
316
matrix:
32-
- LUA=lua5.3
33-
- LUA=lua5.2
34-
- LUA=lua5.1
35-
- LUA=luajit
36-
37-
sudo: required
38-
7+
- LUA="lua=5.3"
8+
- LUA="lua=5.2"
9+
- LUA="lua=5.1"
10+
- LUA="luajit=2.1"
11+
- LUA="luajit=2.0"
3912

4013
before_install:
41-
# Put back the links for libyaml, which are missing on recent Travis VMs
42-
- test -f /usr/lib/libyaml.so ||
43-
sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \;
44-
45-
# Fetch Lua sources.
46-
- cd $TRAVIS_BUILD_DIR
47-
- 'if test lua5.3 = "$LUA"; then
48-
curl http://www.lua.org/ftp/lua-$LUA53_VER.tar.gz | tar xz;
49-
cd lua-$LUA53_VER;
50-
fi'
51-
- 'if test lua5.2 = "$LUA"; then
52-
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz;
53-
cd lua-5.2.4;
54-
fi'
55-
- 'if test lua5.1 = "$LUA"; then
56-
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz;
57-
cd lua-5.1.5;
58-
fi'
59-
60-
# Unpack, compile and install Lua.
61-
- 'if test luajit = "$LUA"; then
62-
curl http://luajit.org/download/LuaJIT-$LUAJIT_VER.tar.gz | tar xz;
63-
cd LuaJIT-$LUAJIT_VER;
64-
make && sudo make install;
65-
for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do
66-
if test -f /usr/local/include/$LUAJIT_DIR/$header; then
67-
sudo ln -s /usr/local/include/$LUAJIT_DIR/$header /usr/local/include/$header;
68-
fi;
69-
done;
70-
else
71-
for src in src/*.c; do
72-
test src/lua.c = "$src" || test src/luac.c = "$src" || eval $_COMPILE $_CFLAGS -c $src;
73-
done;
74-
eval $_LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo;
75-
sudo mkdir -p $libdir;
76-
eval sudo $_INSTALL lib$LUA.la $libdir/lib$LUA.la;
77-
78-
eval $_COMPILE $_CFLAGS -c src/lua.c;
79-
eval $_LINK -static -o $LUA lua.lo lib$LUA.la $_LIBS;
80-
sudo mkdir -p $bindir;
81-
eval sudo $_INSTALL $LUA $bindir/$LUA;
82-
83-
sudo mkdir -p $incdir;
84-
for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do
85-
if test -f src/$header; then
86-
eval sudo $_INSTALL src/$header $incdir/$header;
87-
fi;
88-
done;
89-
fi'
90-
91-
# Fetch LuaRocks.
92-
- cd $TRAVIS_BUILD_DIR
93-
- 'git clone https://github.com/keplerproject/luarocks.git luarocks-$LUAROCKS_VER'
94-
- cd luarocks-$LUAROCKS_VER
95-
- git checkout v$LUAROCKS_VER
96-
97-
# Compile and install luarocks.
98-
- if test luajit = "$LUA"; then
99-
./configure --lua-suffix=jit;
100-
else
101-
./configure;
102-
fi
103-
- 'make build && sudo make install'
104-
105-
# Tidy up file droppings.
106-
- cd $TRAVIS_BUILD_DIR
107-
- rm -rf lua-$LUA53_VER lua-5.2.4 lua-5.1.5 LuaJIT-$LUAJIT_VER luarocks-$LUAROCKS_VER
108-
14+
- pip install hererocks
15+
- hererocks here -r^ --$LUA
16+
- export PATH=$PWD/here/bin:$PATH
10917

11018
install:
111-
# Use Lua 5.3 compatible rocks, where available.
112-
- 'for rock in ansicolors ldoc specl""; do
113-
if test -z "$rock"; then break; fi;
114-
if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
115-
sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
116-
done'
117-
118-
# Build from rockspec, forcing uninstall of older luarocks installed
119-
# above when testing the git rockspec, both for enforcing backwards
120-
# compatibility by default, and for ease of maintenance.
121-
- if test -f "stdlib-$_VERSION-1.rockspec"; then
122-
sudo luarocks make "stdlib-$_VERSION-1.rockspec" LUA="$LUA";
123-
else
124-
sudo luarocks make 'stdlib-git-1.rockspec' LUA="$LUA";
125-
fi
126-
127-
# Clean up files created by root
128-
- sudo git clean -dfx
129-
- sudo rm -rf /tmp/ldoc
130-
19+
- luarocks install ldoc
20+
- luarocks install ansicolors
21+
- luarocks install specl
22+
- luarocks install luacov
13123

13224
script:
133-
# Verify local build.
134-
- make check LUA=$LUA
25+
- make
26+
- luarocks make
27+
- make check SPECL_OPTS='-vfreport --coverage'
13528

29+
after_success:
30+
- tail luacov.report.out
31+
- bash <(curl -s https://codecov.io/bash) -v
13632

13733
notifications:
13834
slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ by the [stdlib project][github]
55

66
[![License](http://img.shields.io/:license-mit-blue.svg)](http://mit-license.org)
77
[![travis-ci status](https://secure.travis-ci.org/lua-stdlib/lua-stdlib.png?branch=master)](http://travis-ci.org/lua-stdlib/lua-stdlib/builds)
8+
[![codecov.io](https://codecov.io/gh/lua-stdlib/lua-stdlib/branch/master/graph/badge.svg)](https://codecov.io/gh/lua-stdlib/lua-stdlib)
89
[![Stories in Ready](https://badge.waffle.io/lua-stdlib/lua-stdlib.png?label=ready&title=Ready)](https://waffle.io/lua-stdlib/lua-stdlib)
910

1011

0 commit comments

Comments
 (0)