Skip to content

Add ci tests #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Tests

on: [push, pull_request]

jobs:
x64-ubuntu:
name: X64-ubuntu
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v2
with:
path: |
_neovim
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}

- name: Prepare
run: |
sudo apt-get install sqlite3 libsqlite3-dev
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start

- name: Run tests
run: |
curl -OL https://raw.githubusercontent.com/norcalli/bot-ci/master/scripts/github-actions-setup.sh
source github-actions-setup.sh nightly-x64
make test

appimage-ubuntu:
name: Appimage-ubuntu
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v2
with:
path: |
build
key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }}

- name: Prepare
run: |
sudo apt-get install sqlite3 libsqlite3-dev
test -d build || {
mkdir -p build
wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
chmod +x nvim.appimage
mv nvim.appimage ./build/nvim
}
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start

- name: Run tests
run: |
export PATH="${PWD}/build/:${PATH}"
make test
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Linting and style checking

on: [push, pull_request]

jobs:
luacheck:
name: Luacheck
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Prepare
run: |
sudo apt-get update
sudo apt-get install luarocks
sudo luarocks install luacheck

- name: Lint
run: sudo make lint
16 changes: 16 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Re-run tests only if their modification time changed.
cache = true
std = luajit
codes = true
self = false

-- Glorious list of warnings: https://luacheck.readthedocs.io/en/stable/warnings.html
ignore = {
"212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
"122", -- Indirectly setting a readonly global
}

-- Global objects defined by the C code
read_globals = {
"vim",
}
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test:
nvim --headless -c 'PlenaryBustedDirectory lua/test/auto/'

lint:
luacheck lua/
2 changes: 2 additions & 0 deletions test/minimal_init.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set rtp+=.
nn m<space> :PlenaryBustedDirectory test/auto/ { minimal_init = 'tests/minimal_init.vim' }<cr>