diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5dc977c..89395c7 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,6 +1,5 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "CopilotChat.nvim": { "branch": "canary", "commit": "451d365928a994cda3505a84905303f790e28df8" }, "LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" }, "auto-session": { "branch": "main", "commit": "5a269bb5bec50b8b60564aa00f6454d9e82fbe8d" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, @@ -12,7 +11,6 @@ "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "copilot.lua": { "branch": "master", "commit": "8aebaa3a102125fedf08c98773a0a8def92fff37" }, "csvview.nvim": { "branch": "main", "commit": "bbab4c2f808fd8e11ec8dfdd128251aadba566a1" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "endpoint.nvim": { "branch": "master", "commit": "33108d5f96690b585bfcc1e3a6093d689835a74b" }, diff --git a/.github/workflows/nvim-check.yml b/.github/workflows/nvim-check.yml new file mode 100644 index 0000000..4eb8df9 --- /dev/null +++ b/.github/workflows/nvim-check.yml @@ -0,0 +1,226 @@ +name: Neovim Checks + +on: + push: + branches: [ main, automation-checks ] + paths: + - '.config/nvim/**' + - '.github/workflows/nvim-check.yml' + - 'Brewfile' + pull_request: + branches: [ main ] + paths: + - '.config/nvim/**' + - '.github/workflows/nvim-check.yml' + - 'Brewfile' + workflow_dispatch: + +jobs: + neovim-check: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Cache mise installations + uses: actions/cache@v4 + with: + path: | + ~/.local/share/mise + ~/.cache/mise + ~/.local/share/ruby-build + ~/.cache/ruby-build + key: mise-${{ runner.os }}-${{ hashFiles('**/tool-versions', '.tool-versions', '.config/nvim/.tool-versions') }} + restore-keys: | + mise-${{ runner.os }}- + + - name: Install system dependencies + run: | + set -euo pipefail + + # Update package lists + sudo apt-get update + + # Install build essentials and dependencies + sudo apt-get install -y \ + build-essential \ + curl \ + git \ + unzip \ + gettext \ + cmake \ + ninja-build + + - name: Install Homebrew + run: | + set -euo pipefail + + # Install Homebrew + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # Add to PATH + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH + + # Configure environment + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + /home/linuxbrew/.linuxbrew/bin/brew shellenv >> $GITHUB_ENV + + - name: Install core tools via Homebrew + run: | + set -euo pipefail + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + + # Install tools from Brewfile + brew bundle --no-lock --file=Brewfile + + echo "✅ Core tools installed" + + - name: Install mise and setup languages + run: | + set -euo pipefail + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + + # Activate mise + eval "$(mise activate bash)" + + # Install from .tool-versions files if they exist + if [ -f ".tool-versions" ]; then + echo "Installing from root .tool-versions" + mise install + fi + + if [ -f ".config/nvim/.tool-versions" ]; then + echo "Installing from .config/nvim/.tool-versions" + cd .config/nvim + mise install + cd ../.. + fi + + # Install common languages for Neovim plugins + mise install python@3.11 || true + mise install nodejs@20 || true + mise install ruby@3.2 || true + mise install go@latest || true + mise install rust@latest || true + + - name: Install language packages + run: | + set -euo pipefail + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + eval "$(mise activate bash)" + + # Python packages + if command -v python3 >/dev/null 2>&1; then + python3 -m pip install --user --upgrade pip + python3 -m pip install --user pynvim debugpy black isort mypy flake8 + echo "✅ Python packages installed" + fi + + # Node packages + if command -v npm >/dev/null 2>&1; then + npm install -g neovim typescript typescript-language-server + echo "✅ Node packages installed" + fi + + # Rust packages + if command -v cargo >/dev/null 2>&1; then + cargo install stylua || true + echo "✅ Rust packages installed" + fi + + - name: Setup Neovim configuration + run: | + set -euo pipefail + + # Copy Neovim config + mkdir -p ~/.config/nvim + cp -r .config/nvim/* ~/.config/nvim/ + + echo "✅ Neovim configuration copied" + + - name: Cache Neovim plugins + uses: actions/cache@v4 + with: + path: | + ~/.local/share/nvim + ~/.cache/nvim + key: nvim-plugins-${{ runner.os }}-${{ hashFiles('.config/nvim/lazy-lock.json') }} + restore-keys: | + nvim-plugins-${{ runner.os }}- + + - name: Install Neovim plugins + run: | + set -euo pipefail + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + eval "$(mise activate bash)" + + echo "Installing Neovim plugins..." + + # Test basic Neovim startup first + echo "Testing Neovim startup..." + nvim --version + nvim --headless -c "echo 'Neovim started successfully'" -c "qall" + + # Bootstrap lazy.nvim and install plugins in one step + echo "Bootstrapping lazy.nvim and installing plugins..." + nvim --headless -c "lua require('lazy').install({wait=true})" -c "qall" 2>&1 || { + echo "First attempt failed, trying sync..." + nvim --headless -c "lua require('lazy').sync({wait=true})" -c "qall" 2>&1 || { + echo "Plugin installation failed, but continuing..." + } + } + + echo "✅ Plugin installation completed" + + - name: Run Neovim health check + run: | + set -euo pipefail + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + eval "$(mise activate bash)" + + echo "Running Neovim health check..." + + # Run health check + nvim --headless -c "checkhealth" -c "write! health-report.txt" -c "qall" || true + + if [ -f health-report.txt ]; then + echo "=== NEOVIM HEALTH REPORT ===" + cat health-report.txt + echo "==========================" + + # Check for critical errors + if grep -i "ERROR" health-report.txt | grep -v "WARNING" | head -5; then + echo "⚠️ Found some errors in health check" + fi + else + echo "❌ Health report not generated" + exit 1 + fi + + echo "✅ Health check completed" + + - name: Show installed versions + run: | + set -euo pipefail + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + eval "$(mise activate bash)" + + echo "=== INSTALLED VERSIONS ===" + echo "Neovim: $(nvim --version | head -1 || echo 'not found')" + echo "Python: $(python3 --version 2>/dev/null || echo 'not found')" + echo "Node: $(node --version 2>/dev/null || echo 'not found')" + echo "Ruby: $(ruby --version 2>/dev/null || echo 'not found')" + echo "Go: $(go version 2>/dev/null || echo 'not found')" + echo "Rust: $(rustc --version 2>/dev/null || echo 'not found')" + echo "=========================" + + - name: Upload health report + if: always() + uses: actions/upload-artifact@v4 + with: + name: neovim-health-report + path: health-report.txt + retention-days: 30 \ No newline at end of file diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..f3f237d --- /dev/null +++ b/Brewfile @@ -0,0 +1,14 @@ +# Core tools for Neovim development +brew "mise" +brew "neovim" +brew "ripgrep" +brew "fd" +brew "git" +brew "curl" +brew "wget" +brew "lua" +brew "luarocks" + +# Optional tools that some Neovim plugins might need +brew "tree-sitter" +brew "fzf" \ No newline at end of file