Skip to content

Add type checking with Lua Language Server type annotations #13

Add type checking with Lua Language Server type annotations

Add type checking with Lua Language Server type annotations #13

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Lint
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
path: ./file-browser
- name: Get LuaLS version
id: get-luaLS-version
run: |
version=$(curl https://api.github.com/repos/LuaLS/lua-language-server/releases/latest | jq -r '.tag_name')
echo $version
echo "version=$version" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Lua Language Server
uses: actions/cache@v4
id: cache
with:
key: ${{ steps.get-luaLS-version.outputs.version }}
path: ./luals
- uses: actions/checkout@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
repository: LuaLS/lua-language-server
ref: ${{ steps.get-luaLS-version.outputs.version }}
path: ./luals
# Runs a single command using the runners shell
- name: Install Lua Language Server
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ./luals
run: |
echo Running Lua Language Server build script
sudo apt-get update
sudo apt-get -y install ninja-build
./make.sh
# Runs a set of commands using the runners shell
- name: Run LuaLS
run: |
./luals/bin/lua-language-server --check ./file-browser --logpath ./log
cat ./log/check.json
- uses: actions/upload-artifact@v4
with:
name: lua-language-server type check
path: ./log/check.json