ci: action downloads and installs luals

This commit is contained in:
Alexander Courtis
2023-12-09 13:57:26 +11:00
parent 820b7b386f
commit b5de0c1846
2 changed files with 14 additions and 14 deletions

View File

@@ -45,9 +45,18 @@ jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
LUALS_VERSION: 3.7.3
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: install
run: |
mkdir -p luals
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/${LUALS_VERSION}/lua-language-server-${LUALS_VERSION}-linux-x64.tar.gz" | tar zx --directory luals
- name: lua-language-server --check - name: lua-language-server --check
run: | run: |
scripts/luals-check PATH="luals/bin:${PATH}" scripts/luals-check

View File

@@ -4,24 +4,15 @@
# luals-out/check.json will be produced on any issues, returning 1. # luals-out/check.json will be produced on any issues, returning 1.
# Outputs only check.json to stdout, all other messages to stderr, to allow jq etc. # Outputs only check.json to stdout, all other messages to stderr, to allow jq etc.
VER_LLS="3.7.3" DIR_SRC="lua"
DIR_OUT="luals-out"
DIR_SRC="${PWD}"
DIR_OUT="${DIR_SRC}/luals-out"
DIR_LLS="/tmp/lls"
# clear output # clear output
rm -rf "${DIR_OUT}" rm -rf "${DIR_OUT}"
mkdir "${DIR_OUT}" mkdir "${DIR_OUT}"
if [ ! -d "${DIR_LLS}" ]; then # execute inside lua to prevent luals itself from being checked
# download lua-language-server binaries OUT=$(lua-language-server --check "${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error)
mkdir -p "${DIR_LLS}"
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/${VER_LLS}/lua-language-server-${VER_LLS}-linux-x64.tar.gz" | tar zx --directory "${DIR_LLS}"
fi
# execute from within the lua-language-server directory as it expects specific file locations
OUT=$("${DIR_LLS}/bin/lua-language-server" --checklevel=Information --check "${DIR_SRC}" --logpath="${DIR_OUT}" --loglevel=error)
RC=$? RC=$?
echo "${OUT}" >&2 echo "${OUT}" >&2