Run tests on gh actions

Related #60.

Can't figure out what's wrong with travis, but gh actions seem to work.
Migrated travis.yml to runtest.yml.

coveralls fails for me because I don't have the account there, but it's
reporting coverage amounts before it fails to upload.

Tests against multiple versions of lua using leafo's matrix.luaversion
with roughly the same versions as travis.yml.

What's missing
==============

Notification setup from travis is missing. Github sends email
notifications. You can choose:
 * Email
 * Web
 * Send notifications for failed workflows only
There are third-party irc gh actions, but I don't see how you'd do
`on_success: change` in an action.

luacheck was disabled in travis.yml, so it's disabled here too.
This commit is contained in:
David Briscoe 2021-06-23 14:57:08 -07:00
parent 7a7e748430
commit 6bc8193a5a

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

@ -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