ci: initial teal pipelines
This commit is contained in:
parent
f3f0a25da6
commit
a839b29515
|
@ -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
|
|
@ -1,23 +1,36 @@
|
||||||
variables:
|
variables:
|
||||||
- &when_path
|
- &when_path_lua
|
||||||
- ".woodpecker/lint.yml"
|
- ".woodpecker/lint.yml"
|
||||||
- "**/*.lua"
|
- "**/*.lua"
|
||||||
|
- &when_path_teal
|
||||||
|
- ".woodpecker/lint.yml"
|
||||||
|
- "**/*.tl"
|
||||||
|
|
||||||
pipeline:
|
pipeline:
|
||||||
lint:
|
lint-lua:
|
||||||
image: ghcr.io/lunarmodules/luacheck:v0.26.1
|
image: ghcr.io/lunarmodules/luacheck:v0.26.1
|
||||||
group: lint
|
group: lint
|
||||||
commands:
|
commands:
|
||||||
- apk add just
|
- apk add just
|
||||||
- just check-lua
|
- just check-lua
|
||||||
when:
|
when:
|
||||||
path: *when_path
|
path: *when_path_lua
|
||||||
|
|
||||||
style:
|
style-lua:
|
||||||
image: alpine:edge # Stylua is only available on edge repository for now
|
image: alpine:edge # Stylua is only available on edge repository for now
|
||||||
group: lint
|
group: lint
|
||||||
commands:
|
commands:
|
||||||
- apk add just stylua
|
- apk add just stylua
|
||||||
- just check-format
|
- just check-format
|
||||||
when:
|
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
|
||||||
|
|
15
justfile
15
justfile
|
@ -1,11 +1,11 @@
|
||||||
lua_version := "5.4"
|
lua_version := "5.4"
|
||||||
lua_bin := "lua" + lua_version
|
lua := "lua" + " -l set_paths"
|
||||||
lua := lua_bin + " -l set_paths"
|
|
||||||
|
|
||||||
rocks_tree := "lua_modules"
|
rocks_tree := "lua_modules"
|
||||||
rockspec_file := "rockspecs/awesomewm.d.tl-dev-1.rockspec"
|
rockspec_file := "rockspecs/awesomewm.d.tl-dev-1.rockspec"
|
||||||
|
|
||||||
lua_targets := `find src/ -iname '*.lua' | xargs` + " " + `ls *.lua | xargs`
|
lua_targets := `find src/ -iname '*.lua' | xargs` + " " + `ls *.lua | xargs`
|
||||||
|
teal_targets := `find src/ types/ -iname '*.tl' | xargs`
|
||||||
|
|
||||||
install:
|
install:
|
||||||
luarocks \
|
luarocks \
|
||||||
|
@ -21,13 +21,20 @@ uninstall:
|
||||||
check-lua *FLAGS:
|
check-lua *FLAGS:
|
||||||
luacheck {{ lua_targets }} {{ FLAGS }}
|
luacheck {{ lua_targets }} {{ FLAGS }}
|
||||||
|
|
||||||
|
check-teal:
|
||||||
|
cyan check {{ teal_targets }}
|
||||||
|
|
||||||
check-format:
|
check-format:
|
||||||
stylua --check {{ lua_targets }}
|
stylua --check {{ lua_targets }}
|
||||||
|
|
||||||
check: check-lua check-format
|
check: check-lua check-format check-teal
|
||||||
|
|
||||||
|
build:
|
||||||
|
cyan build
|
||||||
|
|
||||||
run:
|
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:
|
debug:
|
||||||
{{ lua }} debug.lua src/awesomewm.d.tl/init.lua
|
{{ lua }} debug.lua src/awesomewm.d.tl/init.lua
|
||||||
|
|
Loading…
Reference in New Issue