From 6bc8193a5ac64a86516d89ff82d33b5df81c6a21 Mon Sep 17 00:00:00 2001 From: David Briscoe Date: Wed, 23 Jun 2021 14:57:08 -0700 Subject: [PATCH] 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. --- .github/workflows/runtest.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/runtest.yml 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 +