From 5fac5864dea106076f5da7fd8936ea2f1cab7aea Mon Sep 17 00:00:00 2001 From: Aire-One Date: Tue, 9 Aug 2022 23:32:30 +0200 Subject: [PATCH 1/6] ci: woodpecker initial --- .woodpecker.yml | 12 ++++++++++++ justfile | 9 ++++----- 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..9bc6800 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,12 @@ +pipeline: + prepare: + image: akorn/luarocks:lua5.4-alpine + commands: + - apk add just gcc musl-dev curl-dev + - just install + check: + image: akorn/luarocks:lua5.4-alpine + commands: + - apk add just + - luarocks install luacheck + - just check diff --git a/justfile b/justfile index 1ee8380..ce79ab5 100644 --- a/justfile +++ b/justfile @@ -1,15 +1,14 @@ lua_version := "5.4" +lua_bin := "lua" + lua_version +lua := lua_bin + " -l set_paths" + rocks_tree := "lua_modules" rockspec_file := "rockspecs/awesomewm.d.tl-dev-1.rockspec" -lua_bin := `command -v lua5.4` -lua := lua_bin + " -l set_paths" -luarocks := `command -v luarocks` - lua_targets := `find src/ -iname '*.lua' | xargs` + " " + `ls *.lua | xargs` install: - {{ luarocks }} \ + luarocks \ --lua-version {{ lua_version }} \ install \ --tree {{ rocks_tree }} \ From 654b59b934f4e4ae19b21402dddb30242454d47d Mon Sep 17 00:00:00 2001 From: Aire-One Date: Fri, 12 Aug 2022 19:10:51 +0200 Subject: [PATCH 2/6] ci(lint): initial lint pipeline --- .editorconfig | 3 +++ .woodpecker.yml | 12 ------------ .woodpecker/lint.yml | 13 +++++++++++++ 3 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 .woodpecker.yml create mode 100644 .woodpecker/lint.yml diff --git a/.editorconfig b/.editorconfig index cb33a3b..185c3c8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,3 +16,6 @@ indent_size = 2 [*.json] indent_size = 2 + +[*.yml] +indent_size = 2 diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 9bc6800..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,12 +0,0 @@ -pipeline: - prepare: - image: akorn/luarocks:lua5.4-alpine - commands: - - apk add just gcc musl-dev curl-dev - - just install - check: - image: akorn/luarocks:lua5.4-alpine - commands: - - apk add just - - luarocks install luacheck - - just check diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml new file mode 100644 index 0000000..10bad72 --- /dev/null +++ b/.woodpecker/lint.yml @@ -0,0 +1,13 @@ +pipeline: + lint: + image: ghcr.io/lunarmodules/luacheck:v0.26.1 + group: lint + commands: + - apk add just + - just check-lua + style: + image: alpine:edge # Stylua is only available on edge repository for now + group: lint + commands: + - apk add just stylua + - just check-format From f5efc9c9152c9c356d6071710d3fafca4055bf30 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Fri, 12 Aug 2022 19:15:17 +0200 Subject: [PATCH 3/6] fix: ci style error --- src/awesomewm.d.tl/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/awesomewm.d.tl/init.lua b/src/awesomewm.d.tl/init.lua index 58957bd..0c3dd7a 100644 --- a/src/awesomewm.d.tl/init.lua +++ b/src/awesomewm.d.tl/init.lua @@ -24,8 +24,7 @@ log:info( -- log:info(inspect { items }) -- end -local page = crawler.fetch( - properties.base_url .. "/widgets/awful.widget.button.html" -) +local page = + crawler.fetch(properties.base_url .. "/widgets/awful.widget.button.html") local items = scraper.get_doc_from_page(page) log:info(inspect { items }) From 55db082f617538c88d1309a8992664d99c3c6440 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Fri, 12 Aug 2022 19:26:19 +0200 Subject: [PATCH 4/6] ci(lint): add `when` constraints --- .woodpecker/lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index 10bad72..f81c34b 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -11,3 +11,8 @@ pipeline: commands: - apk add just stylua - just check-format + +when: + branch: master + path: + include: [ '.woodpecker/lint.yml', '*.lua' ] From 485ff3bff9a2a7c734332d31df21585ca37dbb2c Mon Sep 17 00:00:00 2001 From: Aire-One Date: Fri, 12 Aug 2022 19:45:52 +0200 Subject: [PATCH 5/6] ci(lint): fix `when` closes --- .woodpecker/lint.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index f81c34b..1b0620a 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -5,14 +5,16 @@ pipeline: commands: - apk add just - just check-lua + when: + path: + include: [".woodpecker/lint.yml", "*.lua"] + style: image: alpine:edge # Stylua is only available on edge repository for now group: lint commands: - apk add just stylua - just check-format - -when: - branch: master - path: - include: [ '.woodpecker/lint.yml', '*.lua' ] + when: + path: + include: [".woodpecker/lint.yml", "*.lua"] From b3ddaf2fc241a5e747f094a856d407da93c8f1e6 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Fri, 12 Aug 2022 19:36:56 +0200 Subject: [PATCH 6/6] =?UTF-8?q?chore:=20add=20woodpecker=20status=20badge?= =?UTF-8?q?=20in=20README=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 1 + 1 file changed, 1 insertion(+) diff --git a/README.MD b/README.MD index 2ca126b..89a820a 100644 --- a/README.MD +++ b/README.MD @@ -2,6 +2,7 @@ A project to generate Teal types definitions for the Awesome WM based on the API documentation. +[![status-badge](https://woodpecker.aireone.xyz/api/badges/Aire-One/awesomewm.d.tl/status.svg)](https://woodpecker.aireone.xyz/Aire-One/awesomewm.d.tl) # Dependencies Project dependencies :