From 21dec8618a0fa7a3f66ed710c1f8f4f124ab4019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rmet=20Yiltiz?= Date: Thu, 21 Dec 2023 22:35:15 -0500 Subject: [PATCH] Add CI via Github Actions --- .github/workflows/main.yml | 65 ++++++++++++++++++++++++++++++++++++ .github/workflows/stylua.yml | 18 ---------- .luacheckrc | 1 + README.md | 2 ++ init.lua | 15 ++++++++- 5 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/stylua.yml create mode 100644 .luacheckrc diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..7b90464b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,65 @@ +name: Integration based on gbprod/yanky.nvim +on: + push: + branches: [master] + pull_request: + branches: [master] + schedule: + - cron: '0 7 * * 1' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + test: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + nvim-versions: ['stable', 'nightly'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: ${{ matrix.nvim-versions }} + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v8 + with: + luaVersion: '5.1.5' + - name: Setup ‘luarocks’ + uses: leafo/gh-actions-luarocks@v4 + - name: Install dependencies + run: | + luarocks install luacheck + - name: Run linter + run: luacheck init.lua lua/ + - name: Start nvim (no config) + run: | + nvim --version + nvim --headless -u /dev/null -c ":checkhealth" -c ":qa" + - name: Start nvim (using kickstart) + run: | + ln -sf $GITHUB_WORKSPACE "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim + echo "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim + ls -l "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim + touch msg.log + nvim --headless -c ':Lazy! sync' -c ':qa' init.lua 2>&1 | tee -a msg.log + nvim --headless -c ':checkhealth' -c ':qa' init.lua 2>&1 | tee -a msg.log + echo -e '\n+++++++ msg.log ++++++++++++++' + cat msg.log + echo -e '\n+++++++++ errors: ++++++++++++\n' + grepnot(){ ! grep $1 $2; return $?;} + grepnot -i 'error' msg.log # exit with non-zero if "error" match is found + + # Check Lua Formatting + stylua: + name: Check codestyle + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml deleted file mode 100644 index e189fe01..00000000 --- a/.github/workflows/stylua.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Check Lua Formatting -name: Check Lua Formatting -on: pull_request - -jobs: - stylua-check: - name: Stylua Check - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v2 - - name: Stylua Check - uses: JohnnyMorganz/stylua-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: latest - args: --check . - diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 00000000..653f1058 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1 @@ +globals = { "vim" } diff --git a/README.md b/README.md index 78ac6df0..9fe3dca2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # kickstart.nvim +![main build](https://github.com/nvim-lua/kickstart.nvim/actions/workflows/main.yml/badge.svg) + https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b ### Introduction diff --git a/init.lua b/init.lua index 48cf771b..e4f20b29 100644 --- a/init.lua +++ b/init.lua @@ -423,7 +423,20 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, + ensure_installed = { + 'c', + 'cpp', + 'go', + 'lua', + 'python', + 'rust', + 'tsx', + 'javascript', + 'typescript', + 'vimdoc', + 'vim', + 'bash', + }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false,