Merge pull request #62 from idbrii/actions-busted

Run tests on gh actions
This commit is contained in:
Colby Klein 2021-06-23 16:35:33 -07:00 committed by GitHub
commit 002fabb6bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 39 deletions

44
.github/workflows/runtest.yml vendored Normal file
View File

@ -0,0 +1,44 @@
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
continue-on-error: true # don't know why coveralls isn't uploading. For now, let this fail.
run: |
# ignore dotfile directories created by lua setup
~/.luarocks/bin/luacov-coveralls --exclude '^%.%a+$' --repo-token WcsY9jsU97Zt0ZIbGHJftGkC8DsD16FVl
# - name: Run luacheck
# run: luacheck --std max+busted *.lua spec

View File

@ -1,39 +0,0 @@
# http://kiki.to/blog/2016/02/04/talk-continuous-integration-with-lua/
language: python
sudo: false
branches:
only:
- master
- refactor
env:
- LUA="lua=5.1"
- LUA="luajit=2.0"
- LUA="luajit=2.1"
before_install:
- pip install hererocks
- hererocks lua_install -r^ --$LUA
- export PATH=$PATH:$PWD/lua_install/bin
install:
#- luarocks install luacheck
- luarocks install busted
- luarocks install luacov
- luarocks install luacov-coveralls
script:
#- luacheck --std max+busted *.lua spec
- busted --verbose --coverage spec
after_success:
- luacov-coveralls -e $TRAVIS_BUILD_DIR/lua_install
notifications:
irc: "irc.oftc.net#excessive"
recipients:
- shakesoda+travis@gmail.com
email:
on_success: change
on_failure: always