Update task file to latest spooder features
This commit is contained in:
parent
bf53b1f333
commit
f3dab5753e
1 changed files with 24 additions and 30 deletions
54
tasks.lua
54
tasks.lua
|
@ -1,36 +1,30 @@
|
|||
local spooder = require 'spooder'
|
||||
local task = require 'spooder' .task
|
||||
|
||||
spooder.task "test" {
|
||||
task.test {
|
||||
description = "Runs tests";
|
||||
function(helper)
|
||||
helper.run([[
|
||||
rm luacov.stats.out
|
||||
luacheck . || exit
|
||||
busted --coverage --lpath '?.lua' || exit
|
||||
luacov -r html glass.lua
|
||||
]])
|
||||
end
|
||||
'rm luacov.stats.out || true';
|
||||
'luacheck . *.rockspec';
|
||||
'busted --coverage --lpath "?.lua"';
|
||||
'luacov -r html glass.lua';
|
||||
}
|
||||
|
||||
spooder.task "documentation" {
|
||||
task.documentation {
|
||||
description = "Builds and pushes the documentation";
|
||||
depends = { "test"};
|
||||
function(helper)
|
||||
helper.run([[
|
||||
hash=$(git log -1 --format=%h)
|
||||
mkdir -p doc/coverage
|
||||
cp -r luacov-html/* doc/coverage
|
||||
ldoc .
|
||||
cd doc
|
||||
find . | treh -c
|
||||
git add --all
|
||||
if git log -1 --format=%s | grep "$hash$"
|
||||
then git commit --amend --no-edit
|
||||
else git commit -m "Update documentation to $hash"
|
||||
fi
|
||||
git push --force origin doc
|
||||
cd ../
|
||||
git stash pop || true
|
||||
]])
|
||||
end;
|
||||
depends = "test";
|
||||
[[
|
||||
hash=$(git log -1 --format=%h)
|
||||
mkdir -p doc/coverage
|
||||
cp -r luacov-html/* doc/coverage
|
||||
ldoc .
|
||||
cd doc
|
||||
find . | treh -c
|
||||
git add --all
|
||||
if git log -1 --format=%s | grep "$hash$"
|
||||
then git commit --amend --no-edit
|
||||
else git commit -m "Update documentation to $hash"
|
||||
fi
|
||||
git push --force origin doc
|
||||
cd ../
|
||||
git stash pop || true
|
||||
]];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue