-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.lua
44 lines (40 loc) · 910 Bytes
/
tasks.lua
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
local task = require 'spooder' .task
task.install {
description = "Installs the rock";
depends = "test";
'luarocks make';
}
task.clean {
description = "Deletes buildt leftovers";
'rm -rf luacov-html';
'rm -f luacov.report.out';
'rm -f luacov.stats.out';
}
task.test {
description = "Runs tests";
'rm luacov.stats.out || true';
'luacheck .';
'busted --coverage --lpath "?/init.lua;?.lua"';
'luacov -r html skooma.lua';
}
task.documentation {
description = "Builds and pushes the documentation";
depends = { "test"};
[[
hash=$(git log -1 --format=%h)
mkdir -p doc/coverage
cp -r luacov-html/* doc/coverage
rm -r doc/*
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
]]
}