diff options
| author | Florian Fischer <gitlab@muhq.space> | 2021-12-28 12:26:35 +0000 |
|---|---|---|
| committer | Florian Fischer <gitlab@muhq.space> | 2021-12-28 12:26:35 +0000 |
| commit | 1eedbbe9389338f8988c3de524db5b6219322143 (patch) | |
| tree | 0787a93c812964826a182710d2da63005834d1f3 | |
| parent | 655dafe59e35a2bc7bd0785c342c47e3ea860c70 (diff) | |
| parent | 3920d09706ca3a880d41d9e8d4fe53b971d3c748 (diff) | |
| download | vis-lspc-1eedbbe9389338f8988c3de524db5b6219322143.tar.gz vis-lspc-1eedbbe9389338f8988c3de524db5b6219322143.zip | |
Merge branch 'add-gl-ci' into 'master'
Add simple gitlab CI running on ubuntu:rolling
See merge request muhq/vis-lspc!35
| -rw-r--r-- | .gitlab-ci.yml | 23 | ||||
| -rw-r--r-- | Makefile | 7 | ||||
| -rwxr-xr-x | tools/check-format | 8 |
3 files changed, 33 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..93109a8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,23 @@ +image: imolein/luarocks:5.4 + +stages: + - check + - test + +check-luacheck: + stage: check + script: + - luarocks install luacheck + - make check-luacheck + +# check-format: + # stage: check + # script: + # - luarocks install --server=https://luarocks.org/dev luaformatter + # - make check-format + +test: + stage: test + script: + - luarocks install lunatest + - make test @@ -4,19 +4,16 @@ LUA_FILES := $(shell find -name "*.lua" -not -path "./json.lua") TEST_FILES := $(shell find -name "*_test.lua") -# bash's process substitution is used for check-format -SHELL := /bin/bash - check: check-luacheck check-format check-luacheck: luacheck --globals=vis -- $(LUA_FILES) check-format: - for lf in $(LUA_FILES); do diff $$lf <(lua-format $$lf) >/dev/null; done + for lf in $(LUA_FILES); do tools/check-format "$${lf}"; done format: lua-format -i $(LUA_FILES) test: - for tf in $(TEST_FILES); do $$tf; done + for tf in $(TEST_FILES); do "$$tf"; done diff --git a/tools/check-format b/tools/check-format new file mode 100755 index 0000000..392d023 --- /dev/null +++ b/tools/check-format @@ -0,0 +1,8 @@ +#!/bin/sh + +LUA_FILE=$1 +lua-format "${LUA_FILE}" > "${LUA_FILE}.fmt" +diff "${LUA_FILE}" "${LUA_FILE}.fmt" +RET=$? +rm "${LUA_FILE}.fmt" +exit ${RET} |
