wip
PR Prerequisites / Bundles Without Errors (pull_request) Failing after 5s
PR Prerequisites / Lua Check (pull_request) Failing after 18s

This commit is contained in:
2026-09-10 21:01:27 +02:00
parent 8496ddc071
commit 5a9cf68dca
+6 -45
View File
@@ -72,58 +72,19 @@ jobs:
- name: Verify Lua Language Server Installation - name: Verify Lua Language Server Installation
run: ./luals/bin/lua-language-server --version run: ./luals/bin/lua-language-server --version
- name: Resolve Addon Paths And Update Config - name: Update Json
run: | run: |
ADDONS_PATH=$(realpath ./.vscode/lua-addons) FULL_PATH=$(realpath ./.vscode/lua-addons)
ADDON_ROOT=$(find "$ADDONS_PATH" -mindepth 1 -maxdepth 1 -type d | head -n 1) echo "full-path: $FULL_PATH"
LIBRARY_PATH="$ADDON_ROOT/library"
echo "addons-path: $ADDONS_PATH" jq --arg full_path "$FULL_PATH" '.Lua.workspace.library[0] = $full_path' ./.luarc.json > ./.luarc.tmp.json
echo "addon-root: $ADDON_ROOT" mv ./.luarc.tmp.json ./.luarc.json
echo "library-path: $LIBRARY_PATH"
test -d "$ADDON_ROOT"
test -d "$LIBRARY_PATH"
test -f "$LIBRARY_PATH/DcsTypes.lua"
jq \
--arg addons_path "$ADDONS_PATH" \
--arg addon_root "$ADDON_ROOT" \
--arg library_path "$LIBRARY_PATH" \
'.Lua.workspace.library = [$library_path, $addon_root] | .Lua.workspace.userThirdParty = [$addons_path]' \
./.luarc.json > ./.luarc.json.tmp && mv ./.luarc.json.tmp ./.luarc.json
- name: Show Config - name: Show Config
run: cat ./.luarc.json run: cat ./.luarc.json
- name: LuaLS Smoke Test For Addon Globals
run: |
cat > ./_luals_smoke_test.lua << 'EOF'
local now = timer.getTime()
local base = Airbase.getByName("TEST")
local side = coalition.side.RED
return now, base, side
EOF
set -o pipefail
echo "=== smoke(root) ==="
./luals/bin/lua-language-server --check ./_luals_smoke_test.lua --checklevel=Warning --configpath ./.luarc.json 2>&1 | tee ./_luals_smoke_root.log
if grep -q "undefined-global" ./_luals_smoke_root.log; then
echo "Root smoke test reported undefined-global"
exit 1
fi
rm -f ./_luals_smoke_test.lua
- name: Run Lua Language Server - name: Run Lua Language Server
run: | run: ./luals/bin/lua-language-server --check ./src --checklevel=Warning --configpath ./.luarc.json
set -euo pipefail
echo "Checking Lua files one-by-one to keep addon globals resolution consistent"
while IFS= read -r -d '' file; do
echo "Checking $file"
./luals/bin/lua-language-server --check "$file" --checklevel=Warning --configpath ./.luarc.json
done < <(find ./src -type f -name '*.lua' -print0)