Skip to content

LSP fixes.

LSP fixes. #31

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test on ${{ matrix.os }} with Neovim ${{ matrix.nvim-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
nvim-version: [stable, nightly]
# Optionally add other OS if needed:
# os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim-version }}
- name: Install dependencies
run: |
# Install luarocks
sudo apt-get update
sudo apt-get install -y luarocks
# Install luacheck for linting
sudo luarocks install luacheck
- name: Install StyLua
run: |
# Create a temporary directory
mkdir -p ~/.local/bin
# Function to retry commands
function retry {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
count=$((count + 1))
if [ $count -lt $retries ]; then
echo "Command failed. Attempt $count/$retries. Retrying in 5 seconds..."
sleep 5
else
echo "Command failed after $retries attempts. Exiting..."
return $exit
fi
done
return 0
}
# Get latest release with retry
echo "Getting StyLua release information..."
retry 3 curl -s -o release_info.json https://api.github.com/repos/JohnnyMorganz/StyLua/releases/latest
VERSION=$(grep -Po '"tag_name": "\K[^"]*' release_info.json)
echo "Found StyLua version: $VERSION"
# Download StyLua for Linux with retry
echo "Downloading StyLua $VERSION..."
retry 3 curl -L -o stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip"
unzip stylua.zip -d ~/.local/bin
chmod +x ~/.local/bin/stylua
# Add to PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
# Verify installation
echo "Verifying StyLua installation..."
~/.local/bin/stylua --version
- name: Check Neovim version
run: |
nvim --version
- name: Run Linting
run: |
# Run luacheck with our config file
luacheck lua/ tests/ --config=.luacheckrc
- name: Run Tests
run: |
make test