Skip to content

Commit

Permalink
Merge pull request #2 from PowerDNS/gh-actions
Browse files Browse the repository at this point in the history
Add test and luacheck workflows in GH actions
  • Loading branch information
rgacogne authored Sep 30, 2024
2 parents 2485b1d + 99242c6 commit 0208a84
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Luacheck

on:
push:
pull_request:

jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Luacheck linter
uses: lunarmodules/luacheck@v1
with:
args: src/
24 changes: 24 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test features

on:
push:
pull_request:

jobs:
runner-job:
runs-on: ubuntu-latest
services:
nats:
image: nats
ports:
- "4222:4222"
steps:
- name: Install Luarocks
run: sudo apt-get update && sudo apt-get -y --no-install-recommends install luarocks
- name: Install telescope
run: sudo luarocks install telescope
- uses: actions/checkout@v4
- name: Install deps
run: sudo make deps
- name: Test Features
run: make test
3 changes: 3 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
globals = {
"unique_id"
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test:
tsc -f tests/*.lua
make -C tests test

test-deps:
luarocks install telescope
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ services:
nats:
image: nats
ports:
- "4222:4222"
- "4222:4222"
2 changes: 1 addition & 1 deletion src/nats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ local function merge_defaults(parameters)
if parameters == nil then
parameters = {}
end
for k, v in pairs(defaults) do
for k, _ in pairs(defaults) do
if parameters[k] == nil then
parameters[k] = defaults[k]
end
Expand Down
2 changes: 2 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
tsc -f *.lua

0 comments on commit 0208a84

Please sign in to comment.