Skip to content

Commit

Permalink
[ci] Add Github CI Workflow #27
Browse files Browse the repository at this point in the history
Closes #27
  • Loading branch information
devkapilbansal committed Jun 17, 2021
1 parent 8f1e670 commit addc51f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- name: QA-Checks
run: ./run-qa-checks

- name: Tests
run: ./runtests

build:
name: Build and upload package as artifacts
needs: tests
Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ Run quality assurance tests with::

./run-qa-checks

You can run all unit tests by launching the dedicated script::

./runtests

Alternatively, you can run specific tests, e.g.::

cd openwrt-openwisp-monitoring/tests/
lua test_utils.lua -v

Contributing
------------
Expand Down
20 changes: 19 additions & 1 deletion install-dev.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
#!/bin/sh
set -e
apt-get update
# install lua
#install cmake and git
apt-get install -y cmake git
#install lua
apt-get install -y lua5.1 liblua5.1-0-dev luarocks
#install json-c
git clone https://github.com/json-c/json-c.git --depth=1
cd json-c && cmake . && make install && cd .. || { echo 'Installing json-c failed!' ; exit 1; }
# install openwrt libubox and uci
git clone https://git.openwrt.org/project/libubox.git --depth=1
cd libubox && cmake . && make install && cd .. || { echo 'Installing libubox failed!' ; exit 1; }
git clone https://git.openwrt.org/project/uci.git --depth=1
cd uci && cmake . && make install && cd .. || { echo 'Installing uci failed!' ; exit 1; }
#install nixio
luarocks install https://raw.githubusercontent.com/Neopallium/nixio/master/nixio-scm-0.rockspec
# update links to shared libraries
ldconfig -v
# install luaunit
luarocks install luaunit
# install luacheck
luarocks install luacheck
# install lua-cjson
luarocks install lua-cjson
#clean
rm -rf json-c libubox uci
3 changes: 0 additions & 3 deletions openwrt-openwisp-monitoring/tests/env1.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package.path = package.path .. ";../files/lib/?.lua"

local inspect = require('inspect')
local env = {}
local dhcp_data = require('test_files/dhcp_data')
local test_file_dir = './test_files/'

env.inspect = inspect

env.uci = {
cursor = function()
return {
Expand Down

0 comments on commit addc51f

Please sign in to comment.