From 4ad02528b0d431161bb907da0fd0781614d853d6 Mon Sep 17 00:00:00 2001 From: luxus Date: Fri, 4 Oct 2024 00:49:17 +0200 Subject: [PATCH] adding tests --- LICENSE => .github/LICENSE | 0 README.md => .github/README.md | 0 .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++ tests/colorful_times_spec.lua | 0 tests/minimal_init.vim | 7 ++++++ 5 files changed, 46 insertions(+) rename LICENSE => .github/LICENSE (100%) rename README.md => .github/README.md (100%) create mode 100644 .github/workflows/ci.yml create mode 100644 tests/colorful_times_spec.lua create mode 100644 tests/minimal_init.vim diff --git a/LICENSE b/.github/LICENSE similarity index 100% rename from LICENSE rename to .github/LICENSE diff --git a/README.md b/.github/README.md similarity index 100% rename from README.md rename to .github/README.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3f2264b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + neovim-version: ["stable", "nightly"] + lua-version: ["5.1", "5.4"] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Lua + uses: leafo/gh-actions-lua@v9 + with: + luaVersion: ${{ matrix.lua-version }} + + - name: Install Neovim + uses: jayp0521/action-neovim@v2 + with: + neovim-version: ${{ matrix.neovim-version }} + + - name: Install Dependencies + run: | + nvim --headless +'!mkdir -p ~/.local/share/nvim/site/pack/plugins/start' +qall + git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/plugins/start/plenary.nvim + + - name: Run Tests + run: | + nvim --headless -c "PlenaryBustedDirectory tests/ { minimal_init = './tests/minimal_init.vim' }" diff --git a/tests/colorful_times_spec.lua b/tests/colorful_times_spec.lua new file mode 100644 index 0000000..e69de29 diff --git a/tests/minimal_init.vim b/tests/minimal_init.vim new file mode 100644 index 0000000..769e3b1 --- /dev/null +++ b/tests/minimal_init.vim @@ -0,0 +1,7 @@ +" tests/minimal_init.vim + +set runtimepath+=. +set runtimepath+=~/.local/share/nvim/site/pack/plugins/start/plenary.nvim + +" Load your plugin +runtime plugin/colorful-times.lua