formatting #591
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Lua_LS Type Check | |
| on: | |
| workflow_call: | |
| inputs: | |
| lua_ls_version: | |
| required: true | |
| type: string | |
| neovim_versions: | |
| required: true | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| lua_ls_version: | |
| description: "Lua LS version" | |
| required: true | |
| default: "3.14.0" | |
| neovim_versions: | |
| description: "Neovim versions" | |
| required: true | |
| default: '["0.11.2"]' | |
| pull_request: | |
| push: | |
| jobs: | |
| lua-language-server: | |
| name: lua language server | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rev: ${{ fromJson(inputs.neovim_versions || '["0.11.2"]') }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: date +%F > todays-date | |
| - name: Restore cache for Neovim | |
| uses: actions/cache@v3 | |
| with: | |
| path: .ci/neovim | |
| key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }} | |
| - name: Restore cache for vendor dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: .ci/vendor | |
| key: ${{ hashFiles('todays-date') }} | |
| - name: Restore cache for lua LS | |
| uses: actions/cache@v3 | |
| with: | |
| path: .ci/lua-ls | |
| key: ${{ inputs.lua_ls_version || '3.14.0' }} | |
| - name: Clone nvim-lspconfig | |
| run: | | |
| mkdir -p .ci/vendor | |
| if [ ! -d .ci/vendor/nvim-lspconfig/.git ]; then | |
| git clone --depth=1 https://github.com/neovim/nvim-lspconfig .ci/vendor/nvim-lspconfig | |
| fi | |
| - name: Prepare Neovim and Lua LS | |
| run: | | |
| test -d .ci/neovim || { | |
| mkdir -p .ci/neovim | |
| for i in {1..3}; do | |
| if curl -fL "https://github.com/neovim/neovim/releases/download/v${{ matrix.rev }}/nvim-linux-x86_64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/.ci/neovim"; then | |
| break | |
| fi | |
| echo "Download attempt $i failed, retrying..." | |
| sleep 5 | |
| done | |
| } | |
| test -d .ci/lua-ls || { | |
| mkdir -p .ci/lua-ls | |
| for in in {1..3}; do | |
| if curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/${{ inputs.lua_ls_version || '3.14.0' }}/lua-language-server-${{ inputs.lua_ls_version || '3.14.0' }}-linux-x64.tar.gz" | tar xzf - -C "${PWD}/.ci/lua-ls"; then | |
| break | |
| fi | |
| echo "Download attempt $i failed, retrying..." | |
| sleep 5 | |
| done | |
| } | |
| - name: Run check | |
| run: | | |
| export PATH="${PWD}/.ci/neovim/bin:${PATH}" | |
| export PATH="${PWD}/.ci/lua-ls/bin:${PATH}" | |
| export VIMRUNTIME="${PWD}/.ci/neovim/share/nvim/runtime" | |
| nvim --version | |
| make -f ci/Makefile lua_ls-check version=${{ matrix.rev == 'nightly' && 'nightly' || 'stable' }} |