name: Code check
on:
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
  push:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: leafo/gh-actions-lua@v9.1.0
        with:
          luaVersion: "5.2.4"
      - uses: leafo/gh-actions-luarocks@v4.3.0
      - name: Install dependencies
        run: |
          luarocks install busted
          luarocks install cluacov
          luarocks install luacheck
      - name: Run checks
        run: |
          luacheck .
          busted
      - uses: codecov/codecov-action@v3.1.1
