diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml new file mode 100644 index 0000000..d213e59 --- /dev/null +++ b/.woodpecker/build.yml @@ -0,0 +1,26 @@ +depends_on: + - lint + +pipeline: + prepare: + image: akorn/luarocks:lua5.4-alpine + commands: + - apk add just gcc libc-dev musl-dev curl-dev + - just install + build: + image: akorn/luarocks:lua5.4-alpine + commands: + - apk add just gcc musl-dev + - luarocks install cyan + - just build +# TODO : What's after this point is untested since we can't build the project for now + run: + image: akorn/luarocks:lua5.4-alpine + commands: + - apk add just + - just run + verify: + image: alpine:3.16 + commands: + - apk add tree + - tree generated diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index 0ff55d8..f90fc4e 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -1,23 +1,36 @@ variables: - - &when_path + - &when_path_lua - ".woodpecker/lint.yml" - "**/*.lua" + - &when_path_teal + - ".woodpecker/lint.yml" + - "**/*.tl" pipeline: - lint: + lint-lua: image: ghcr.io/lunarmodules/luacheck:v0.26.1 group: lint commands: - apk add just - just check-lua when: - path: *when_path + path: *when_path_lua - style: + style-lua: image: alpine:edge # Stylua is only available on edge repository for now group: lint commands: - apk add just stylua - just check-format when: - path: *when_path + path: *when_path_lua + + lint-teal: + image: akorn/luarocks:lua5.4-alpine + group: lint + commands: + - apk add just gcc libc-dev musl-dev + - luarocks install cyan + - just check-teal + when: + path: *when_path_teal diff --git a/justfile b/justfile index ce79ab5..66d7c64 100644 --- a/justfile +++ b/justfile @@ -1,11 +1,11 @@ lua_version := "5.4" -lua_bin := "lua" + lua_version -lua := lua_bin + " -l set_paths" +lua := "lua" + " -l set_paths" rocks_tree := "lua_modules" rockspec_file := "rockspecs/awesomewm.d.tl-dev-1.rockspec" lua_targets := `find src/ -iname '*.lua' | xargs` + " " + `ls *.lua | xargs` +teal_targets := `find src/ types/ -iname '*.tl' | xargs` install: luarocks \ @@ -21,13 +21,20 @@ uninstall: check-lua *FLAGS: luacheck {{ lua_targets }} {{ FLAGS }} +check-teal: + cyan check {{ teal_targets }} + check-format: stylua --check {{ lua_targets }} -check: check-lua check-format +check: check-lua check-format check-teal + +build: + cyan build run: - {{ lua }} src/awesomewm.d.tl/init.lua + {{ lua }} build/awesomewm.d.tl/init.lua +# TODO : how to run a debugger on Teal code? debug: {{ lua }} debug.lua src/awesomewm.d.tl/init.lua