diff --git a/.github/workflows/runtest.yml b/.github/workflows/runtest.yml new file mode 100644 index 0000000..9ec08cd --- /dev/null +++ b/.github/workflows/runtest.yml @@ -0,0 +1,43 @@ +name: Validate Code + +on: + pull_request: + branches: + - master + - refactor + push: + branches: + - master + - refactor + +jobs: + test: + name: Run Tests + runs-on: ubuntu-latest + + strategy: + matrix: + luaVersion: ["5.1.5", "luajit-2.0.5", "luajit-2.1.0-beta3"] + + steps: + - uses: actions/checkout@v2 + - name: Setup Lua + uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: ${{ matrix.luaVersion }} + - name: Setup Lua Rocks + uses: leafo/gh-actions-luarocks@v4 + - name: Install dependencies + run: | + luarocks --local install busted + luarocks --local install luacov + luarocks --local install luacov-coveralls + - name: Run busted + run: ~/.luarocks/bin/busted --verbose --coverage spec + - name: Upload coverage + run: | + # ignore dotfile directories created by lua setup + ~/.luarocks/bin/luacov-coveralls --exclude '^%.%a+$' + # - name: Run luacheck + # run: luacheck --std max+busted *.lua spec +