-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specs, CI, workflows, minor fixes, refactoing
added specs and refactoring for utils.eval_lua added specs and refactoring for utils.eval_lua more specs added spec load_console more specs added spec for lua_console added specs lua-console win/buf finished specs
- Loading branch information
Showing
26 changed files
with
1,938 additions
and
128 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
return { | ||
_all = { | ||
coverage = false, | ||
lpath = "lua/?.lua;lua/?/init.lua;spec/?.lua", | ||
lua = 'spec/nvim-shim.sh', | ||
-- lua = 'nlua', | ||
ROOT = {'spec'} | ||
}, | ||
default = { | ||
verbose = true | ||
}, | ||
unit = { | ||
ROOT = {'spec/unit'}, | ||
verbose = true, | ||
}, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
name: 'Nvim Busted Action' | ||
description: 'Test Neovim plugins with Busted' | ||
author: 'Marc Jakobi' | ||
branding: | ||
color: 'purple' | ||
icon: 'moon' | ||
inputs: | ||
nvim_version: | ||
description: | | ||
Version of Neovim to install. Valid values are 'stable', 'nightly' or version tag such | ||
as 'v0.9.2'. Note that this value must exactly match to a tag name when installing the | ||
specific version. | ||
required: false | ||
default: 'stable' | ||
luarocks_version: | ||
description: Version of LuaRocks to install. | ||
required: false | ||
default: '3.11.1' | ||
before: | ||
description: Script to run before running tests. | ||
required: false | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- uses: actions/cache@v3 | ||
id: cache-luarocks | ||
name: Restore cache for luarocks packages. | ||
with: | ||
path: | | ||
~/.luarocks | ||
key: ${{ runner.os }}-luarocks-${{ inputs.luarocks_version }} | ||
restore-keys: | | ||
${{ runner.os }}-luarocks- | ||
- run: date +%F > todays-date | ||
shell: bash | ||
- name: Restore cache for today's Neovim nightly. | ||
if: ${{ inputs.nvim_version }} == 'nightly' | ||
uses: actions/cache@v3 | ||
with: | ||
path: _neovim | ||
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }} | ||
|
||
- uses: rhysd/action-setup-vim@v1 | ||
with: | ||
neovim: true | ||
version: ${{ inputs.nvim_version }} | ||
|
||
- name: Setup Lua | ||
uses: leso-kn/gh-actions-lua@master | ||
with: | ||
luaVersion: "5.1" | ||
|
||
- name: Setup LuaRocks | ||
uses: hishamhm/gh-actions-luarocks@master | ||
# FIXME: caching .luarocks doesn't set up the environment variables (PATH, LUA_PATH, ...) properly | ||
# if: steps.cache-luarocks.outputs.cache-hit != 'true' | ||
with: | ||
luarocksVersion: ${{ inputs.luarocks_version }} | ||
|
||
- name: Run 'before' script | ||
if: ${{ inputs.before != '' }} | ||
run: ${{ inputs.before }} | ||
shell: bash | ||
|
||
- name: Install busted and nlua | ||
if: steps.cache-luarocks.outputs.cache-hit != 'true' | ||
run: | | ||
luarocks install busted --local | ||
luarocks install luacheck --local | ||
# luarocks install nlua --local | ||
shell: bash | ||
|
||
- run: make test | ||
# - run: luarocks test --local | ||
shell: bash |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
documentation: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: rhysd/action-setup-vim@v1 | ||
with: | ||
neovim: true | ||
version: stable | ||
|
||
- name: Create API Documentation | ||
run: | | ||
nvim --version | ||
make api_documentation | ||
- name: Create User Documentation | ||
uses: kdheepak/panvimdoc@main | ||
with: | ||
vimdoc: lua-console.nvim # Output vimdoc project name (required) | ||
# The following are all optional | ||
pandoc: "README.md" # Input pandoc file | ||
version: "Neovim >= 0.8.0" | ||
toc: true # Table of contents | ||
description: A handy scratch pad / REPL / debug console for Lua development and Neovim exploration and configuration | ||
titledatepattern: "%Y %B %d" # Pattern for the date that used in the title | ||
demojify: false # Strip emojis from the vimdoc | ||
dedupsubheadings: true # Add heading to subheading anchor links to ensure that subheadings are unique | ||
treesitter: true # Use treesitter for highlighting codeblocks | ||
ignorerawblocks: true # Ignore raw html blocks in markdown when converting to vimdoc | ||
docmapping: false # Use h4 headers as mapping docs | ||
docmappingprojectname: true # Use project name in tag when writing mapping docs | ||
shiftheadinglevelby: 0 # Shift heading levels by specified number | ||
incrementheadinglevelby: 0 # Increment heading levels by specified number | ||
|
||
- name: Generate Tags | ||
run: | | ||
nvim -c 'helptags doc' -c 'quit' | ||
- name: Push Changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "docs(vimdoc): Auto-generate user / API documentation + vimtags" | ||
commit_user_name: "github-actions[bot]" | ||
commit_user_email: "github-actions[bot]@users.noreply.github.com" | ||
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Luacheck | ||
|
||
on: | ||
pull_request: {} | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
jobs: | ||
luacheck: | ||
name: Luacheck | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y luarocks | ||
sudo luarocks install luacheck | ||
- name: Lint | ||
run: make luacheck |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# References: | ||
# https://github.com/nvim-neorocks/sample-luarocks-plugin?tab=readme-ov-file#publishing-to-luarocks | ||
# https://github.com/ellisonleao/nvim-plugin-template/blob/922c0d5249076416c5d84e7c0504f1154225a7ab/.github/workflows/release.yml | ||
# | ||
name: Release To LuaRocks | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
luarocks-upload: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: LuaRocks Upload | ||
uses: nvim-neorocks/luarocks-tag-release@v7 | ||
env: | ||
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: develop | ||
on: | ||
pull_request: ~ | ||
push: | ||
branches: | ||
- develop | ||
jobs: | ||
build: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
neovim_version: ['stable'] | ||
# neovim_version: ['nightly', 'stable'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run tests | ||
uses: ./.github/actions/build | ||
with: | ||
nvim_version: ${{ matrix.neovim_version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: main | ||
on: | ||
pull_request: ~ | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
neovim_version: ['stable'] | ||
# neovim_version: ['nightly', 'stable'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run tests | ||
uses: ./.github/actions/build | ||
with: | ||
nvim_version: ${{ matrix.neovim_version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- Rerun tests only if their modification time changed. | ||
cache = true | ||
|
||
std = luajit | ||
codes = true | ||
|
||
self = false | ||
|
||
-- Reference: https://luacheck.readthedocs.io/en/stable/warnings.html | ||
ignore = { | ||
-- Neovim lua API + luacheck thinks variables like `vim.wo.spell = true` is | ||
-- invalid when it actually is valid. So we have to display rule `W122`. | ||
-- | ||
"122", | ||
"631", -- max_line_length | ||
"621", -- incostistant indentation | ||
"611" -- line with whitespace | ||
} | ||
|
||
-- Global objects defined by the C code | ||
read_globals = { | ||
"vim", | ||
"Lua_console", | ||
"describe", | ||
"it", | ||
"assert" | ||
} | ||
|
||
exclude_files = { } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.PHONY: api_documentation llscheck luacheck stylua test | ||
|
||
api_documentation: | ||
nvim -u scripts/make_api_documentation/minimal_init.lua -l scripts/make_api_documentation/main.lua | ||
|
||
llscheck: | ||
llscheck --configpath .luarc.json . | ||
|
||
luacheck: | ||
luacheck lua spec # plugin scripts | ||
|
||
stylua: | ||
stylua lua plugin scripts spec | ||
|
||
test: | ||
eval $(luarocks path --lua-version 5.1 --bin) | ||
busted --run unit | ||
|
||
watch: | ||
while sleep 0.1; do ls -d spec/**/*.lua | entr -d -c make test; done |
This file contains 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
Oops, something went wrong.