Skip to content

Commit

Permalink
build: πŸ‘·πŸ»β€β™€οΈ CI and GA pipeline enhancements #1
Browse files Browse the repository at this point in the history
  • Loading branch information
puria committed Jan 28, 2022
2 parents d73f2e9 + 5de4350 commit 69fdc52
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/busted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: |
luarocks install busted
luarocks install luacov-coveralls
- run: luarocks build
- run: busted -c -v
- name: Report test coverage
if: success()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
lua-version: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"]
lua-version: ["5.4", "5.3", "5.2", "5.1", "luajit"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# SPDX-FileCopyrightText: 2022 2022 Puria Nafisi Azizi <puria@dyne.org>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

.PHONY: test local build lint clean

LUA_VERSION:=5.1
LUA_TREE:=lua_modules
MODULE:=lua-starter-template
ROCKS:=luarocks --lua-version=${LUA_VERSION} --tree=${LUA_TREE}
LUA_PATH:="$$(luarocks --lua-version=${LUA_VERSION} path --lr-path);;"
LUA_CPATH="$$(luarocks --lua-version=${LUA_VERSION} path --lr-cpath);;"
BIN:=${LUA_TREE}/bin


local: build
${ROCKS} make --force --local ${MODULE}-dev-1.rockspec
Expand All @@ -13,21 +20,22 @@ deps:
${ROCKS} install busted
${ROCKS} install luacheck
${ROCKS} install luacov
python3 -m pip install --user pipx

build:
${ROCKS} build
# ${ROCKS} make ${MODULE}-dev-1.rockspec

test: luarocks build
LUA_PATH="$$(luarocks --lua-version=${LUA_VERSION} path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=${LUA_VERSION} path --lr-cpath);;" ${LUA_TREE}/bin/busted spec
LUA_PATH=${LUA_PATH} LUA_CPATH=${LUA_CPATH} ${BIN}/busted spec

luarocks:
luarocks init --lua-versions=${LUA_VERSION}
eval $(luarocks --lua-version=${LUA_VERSION} path)

lint:
pipx run reuse lint
luacheck .
LUA_PATH=${LUA_PATH} LUA_CPATH=${LUA_CPATH} ${BIN}/luacheck .

clean:
rm -rf ${LUA_TREE} lua luarocks .luarocks luacov.stats.out
4 changes: 4 additions & 0 deletions lua-starter-template-dev-1.rockspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-- SPDX-FileCopyrightText: 2022 Puria Nafisi Azizi <puria@dyne.org>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

package = "lua-starter-template"
version = "dev-1"
source = {
Expand Down
4 changes: 4 additions & 0 deletions spec/test1_spec.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-- SPDX-FileCopyrightText: 2022 2022 Puria Nafisi Azizi <puria@dyne.org>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

local m = require("starter")

describe("Busted unit testing framework", function()
Expand Down

0 comments on commit 69fdc52

Please sign in to comment.