2022-12-25 10:56:06 +00:00
|
|
|
local task = require 'spooder' .task
|
2022-10-09 08:21:33 +00:00
|
|
|
|
2022-12-25 10:56:06 +00:00
|
|
|
task.test {
|
2022-10-09 08:21:33 +00:00
|
|
|
description = "Runs tests";
|
2022-12-25 10:56:06 +00:00
|
|
|
'rm luacov.stats.out || true';
|
|
|
|
'luacheck . *.rockspec';
|
|
|
|
'busted --coverage --lpath "?.lua"';
|
|
|
|
'luacov -r html glass.lua';
|
2022-10-09 08:21:33 +00:00
|
|
|
}
|
|
|
|
|
2022-12-25 10:56:06 +00:00
|
|
|
task.documentation {
|
2022-10-09 08:21:33 +00:00
|
|
|
description = "Builds and pushes the documentation";
|
2022-12-25 10:56:06 +00:00
|
|
|
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
|
|
|
|
]];
|
2022-10-09 08:21:33 +00:00
|
|
|
}
|