Merge pull request #15 from venkatarenduchintala/feat/ci-plugin-valid… #9
Workflow file for this run
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: Validate Neovim Config | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| validate: | |
| name: Build & validate Neovim | |
| runs-on: ubuntu-latest | |
| # Skip docs: and chore: commits on push; always run on pull requests | |
| if: | | |
| github.event_name == 'pull_request' || | |
| ( | |
| !startsWith(github.event.head_commit.message, 'docs:') && | |
| !startsWith(github.event.head_commit.message, 'chore:') | |
| ) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build devcontainer image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: .devcontainer/Dockerfile | |
| tags: nvim-config:ci | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Check Neovim version | |
| run: docker run --rm nvim-config:ci nvim --version | |
| - name: Prepare plugin data directory | |
| run: | | |
| mkdir -p $HOME/.local/share/nvim-ci | |
| chmod 777 $HOME/.local/share/nvim-ci | |
| - name: Cache lazy.nvim plugins | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/share/nvim-ci | |
| key: nvim-plugins-${{ hashFiles('lua/plugins/**/*.lua') }} | |
| restore-keys: nvim-plugins- | |
| - name: Install plugins via lazy.nvim | |
| run: | | |
| docker run --rm \ | |
| -e CI=true \ | |
| -v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \ | |
| -v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \ | |
| nvim-config:ci \ | |
| nvim --headless \ | |
| -c "lua require('lazy').sync({wait=true, show=false})" \ | |
| -c "qall" | |
| timeout-minutes: 15 | |
| - name: Validate Neovim loads with all plugins | |
| run: | | |
| docker run --rm \ | |
| -e CI=true \ | |
| -v "${{ github.workspace }}:/home/dev/.config/nvim:ro" \ | |
| -v "$HOME/.local/share/nvim-ci:/home/dev/.local/share/nvim" \ | |
| nvim-config:ci \ | |
| nvim --headless -c "qall" | |
| timeout-minutes: 2 |