-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from cameronr/main
Unit test fixes and run them as a GH action
- Loading branch information
Showing
28 changed files
with
433 additions
and
208 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,55 @@ | ||
# From | ||
# https://github.com/shortcuts/neovim-plugin-boilerplate/blob/main/.github/workflows/main.yml | ||
|
||
name: tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: JohnnyMorganz/stylua-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version: latest | ||
args: --check . -g '*.lua' -g '!deps/' | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 2 | ||
strategy: | ||
matrix: | ||
neovim_version: ["v0.7.2", "v0.8.3", "v0.9.5", "v0.10.0", "nightly"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: date +%F > todays-date | ||
|
||
- name: restore cache for today's nightly. | ||
uses: actions/cache@v4 | ||
with: | ||
path: _neovim | ||
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }} | ||
|
||
- name: setup neovim | ||
uses: rhysd/action-setup-vim@v1 | ||
with: | ||
neovim: true | ||
version: ${{ matrix.neovim_version }} | ||
|
||
- name: install ripgrep | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ripgrep | ||
- name: run tests | ||
run: | | ||
make test |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Auto-generated tag files | ||
doc/tags | ||
.luarc.json | ||
.test | ||
.build_tools | ||
|
||
tests/test_sessions | ||
|
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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
PLENARY_VER = v0.1.4 | ||
PLENARY_DIR = .build_tools/plenary | ||
PLENARY_DIR = .test/plenary | ||
PLENARY_URL = https://github.com/nvim-lua/plenary.nvim | ||
|
||
FILES := $(wildcard tests/*_spec.lua) | ||
|
||
.PHONY: test $(FILES) args-tests | ||
test: $(PLENARY_DIR) $(FILES) args-tests | ||
|
||
$(FILES): | ||
nvim --clean --headless --embed -u tests/minimal.vim +"PlenaryBustedFile $@" | ||
$(FILES): $(PLENARY_DIR) | ||
nvim --clean --headless -u tests/minimal.lua +"PlenaryBustedFile $@" | ||
|
||
|
||
args-tests: | ||
nvim --clean --headless --embed -u tests/minimal.vim +"PlenaryBustedFile tests/args/args_setup_spec.lua" | ||
nvim --clean --headless --embed -u tests/minimal.vim +"PlenaryBustedFile tests/args/args_not_enabled_spec.lua" | ||
nvim --clean --headless --embed -u tests/minimal.vim +"PlenaryBustedFile tests/args/args_single_dir_enabled_spec.lua" | ||
nvim --clean --headless --embed -u tests/minimal.vim +"PlenaryBustedFile tests/args/args_files_enabled_spec.lua" | ||
args-tests: $(PLENARY_DIR) | ||
nvim --clean --headless -u tests/minimal.lua +"PlenaryBustedFile tests/args/args_setup_spec.lua" | ||
nvim --clean --headless -u tests/minimal.lua +"PlenaryBustedFile tests/args/args_not_enabled_spec.lua" | ||
nvim --clean --headless -u tests/minimal.lua +"PlenaryBustedFile tests/args/args_single_dir_enabled_spec.lua" | ||
nvim --clean --headless -u tests/minimal.lua +"PlenaryBustedFile tests/args/args_files_enabled_spec.lua" | ||
|
||
|
||
$(PLENARY_DIR): | ||
git clone --depth=1 --branch $(PLENARY_VER) $(PLENARY_URL) $(PLENARY_DIR) | ||
git clone --depth=1 --branch $(PLENARY_VER) $(PLENARY_URL) $(PLENARY_DIR) |
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.