Skip to content

fix diagnostic err #170

fix diagnostic err

fix diagnostic err #170

Workflow file for this run

name: CI
env:
TRIPTYCH_DIR: .local/share/nvim/site/pack/simonmclean/start/triptych
LUA_LS_LOG_PATH: /home/runner/lua-language-server/logs
LATEST_NVIM_VERSION: "0.10.1"
on:
push:
branches: [ "main" ]
paths:
- 'lua/**'
- 'unit_tests/**'
pull_request:
branches: [ "main" ]
paths:
- 'lua/**'
- 'unit_tests/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- name: install neovim 0.9.0
run: |
cd $HOME
curl -OJL https://github.com/neovim/neovim/releases/download/v0.9.0/nvim-linux64.tar.gz
tar xzf *.tar.gz
mv $HOME/nvim-linux64 $HOME/nvim-linux64-0.9.0
rm nvim-linux64.tar.gz
$HOME/nvim-linux64-0.9.0/bin/nvim --version
- name: install latest stable neovim
run: |
cd $HOME
curl -OJL https://github.com/neovim/neovim/releases/download/v$LATEST_NVIM_VERSION/nvim-linux64.tar.gz
tar xzf *.tar.gz
mv $HOME/nvim-linux64 $HOME/nvim-linux64-$LATEST_NVIM_VERSION
rm nvim-linux64.tar.gz
$HOME/nvim-linux64-$LATEST_NVIM_VERSION/bin/nvim --version
- name: install neovim plugins
run: |
git config --global advice.detachedHead false
git clone https://github.com/nvim-lua/plenary.nvim.git $HOME/.local/share/nvim/site/pack/plenary/start/plenary
git clone https://github.com/nvim-tree/nvim-web-devicons $HOME/.local/share/nvim/site/pack/nvim-tree/start/nvim-web-devicons
git clone --recurse-submodules https://github.com/$GITHUB_REPOSITORY $HOME/$TRIPTYCH_DIR
cd $HOME/$TRIPTYCH_DIR
git checkout $GITHUB_HEAD_REF
- name: install lua-language-server
run: |
mkdir $HOME/lua-language-server
cd $HOME/lua-language-server
curl -OJL https://github.com/LuaLS/lua-language-server/releases/download/3.7.2/lua-language-server-3.7.2-linux-x64.tar.gz
tar -xzf *.tar.gz
$HOME/lua-language-server/bin/lua-language-server --version
- name: check diagnostics
run: |
cd $HOME/$TRIPTYCH_DIR
$HOME/lua-language-server/bin/lua-language-server --logpath=$LUA_LS_LOG_PATH --check $HOME/$TRIPTYCH_DIR
if [ -r $LUA_LS_LOG_PATH/check.json ]; then cat $LUA_LS_LOG_PATH/check.json; exit 1; fi
- name: check formatting
run: |
cd $HOME/$TRIPTYCH_DIR
npx @johnnymorganz/stylua-bin --check .
- name: run unit tests against neovim 0.9.0
run: |
cd $HOME/$TRIPTYCH_DIR
HEADLESS=true $HOME/nvim-linux64-0.9.0/bin/nvim --headless +"so%" tests/run_specs.lua
- name: run unit tests against latest stable neovim
run: |
cd $HOME/$TRIPTYCH_DIR
HEADLESS=true $HOME/nvim-linux64-$LATEST_NVIM_VERSION/bin/nvim --headless +"so%" tests/run_specs.lua