name: lint

on:
  pull_request:
    branches:
      - "rolling"

jobs:
  lua-linter:
    name: "Linting with luacheck"
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

      - uses: leafo/gh-actions-lua@v8
      - uses: leafo/gh-actions-luarocks@v4

      - name: Use luacheck
        run: luarocks install luacheck

      - name: Run luacheck
        run: make lint-lua

  shellcheck:
    name: Shellcheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run ShellCheck
        uses: ludeeus/action-shellcheck@master
        with:
          scandir: "./utils"
          ignore: "bin"
