name: Error Check

on:
  push:
    branches:
      - '*'
  pull_request:
    branches:
      - '*'

jobs:
  luacheck_errcheck:
    runs-on: ubuntu-latest
    steps:
      - name: Install Lua and Luarocks
        run: |
          sudo apt-get update
          sudo apt-get install -y lua5.1 luarocks

      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Luacheck
        run: luarocks install luacheck

      - name: Run Luacheck
        run: luacheck -v .