From 7aee1aee97017e8be5860d09e0252e05d9a11b3f Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Sun, 9 Oct 2022 10:21:33 +0200 Subject: [PATCH] Add spooder task file --- tasks.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tasks.lua diff --git a/tasks.lua b/tasks.lua new file mode 100644 index 0000000..01296c3 --- /dev/null +++ b/tasks.lua @@ -0,0 +1,36 @@ +local spooder = require 'spooder' + +spooder.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 +} + +spooder.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; +}