Skip to content

Commit 5bbe79f

Browse files
committed
Create matrix for NEOVIM version
1 parent 57cd577 commit 5bbe79f

File tree

4 files changed

+56
-18
lines changed

4 files changed

+56
-18
lines changed

.github/workflows/default.yml

+25-5
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,38 @@ env:
55
jobs:
66
unit-tests:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
neovim-version:
11+
[
12+
"v0.9.0",
13+
"v0.9.1",
14+
"v0.9.2",
15+
"v0.9.4",
16+
"v0.9.5",
17+
"v0.10.0",
18+
"v0.10.1",
19+
"v0.10.2",
20+
"v0.10.3",
21+
"stable",
22+
]
23+
fail-fast: false
24+
25+
name: NEOVIM ${{ matrix.neovim-version }}
826
steps:
927
- name: Checkout
10-
uses: actions/checkout@v3
11-
- name: Pre-build devcontainer image
28+
uses: actions/checkout@v4
29+
- name: Pre-build devcontainer image for NEOVIM ${{ matrix.neovim-version }}
1230
uses: devcontainers/[email protected]
1331
with:
14-
imageName: ${{ env.IMAGE_NAME }}
15-
cacheFrom: ${{ env.IMAGE_NAME }}
32+
imageName: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }}
33+
cacheFrom: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }}
1634
push: never
35+
build-args: |
36+
NEOVIM_VERSION="${{ matrix.neovim-version }}"
1737
- name: Run tests inside the docker image
1838
uses: devcontainers/[email protected]
1939
with:
20-
cacheFrom: ${{ env.IMAGE_NAME }}
40+
cacheFrom: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }}
2141
push: never
2242
runCmd: make test

Dockerfile

+20-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21+
ARG NEOVIM_VERSION="stable"
2122
FROM ubuntu:22.04 as builder
2223

24+
ARG NEOVIM_VERSION
25+
2326
# Install dependencies needed for building devcontainers/cli and developing in neovim
2427
RUN apt-get update && \
2528
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -37,13 +40,25 @@ RUN apt-get update && \
3740
&& apt-get autoremove -y \
3841
&& rm -rf /var/lib/apt/lists/*
3942

40-
WORKDIR /app
43+
WORKDIR /tmp
4144

42-
# Installing the devcontainers CLI
43-
RUN npm install -g @devcontainers/[email protected]
45+
# Install NEOVIM
46+
RUN \
47+
if [ "$NEOVIM_VERSION" = "stable" ]; then \
48+
curl -fLO https://github.com/neovim/neovim/releases/download/${NEOVIM_VERSION}/nvim-linux-x86_64.tar.gz; \
49+
else \
50+
curl -fLO https://github.com/neovim/neovim/releases/download/${NEOVIM_VERSION}/nvim-linux64.tar.gz; \
51+
fi \
52+
&& rm -rf /opt/nvim \
53+
&& tar -C /opt -xzf nvim-*.tar.gz \
54+
&& ln -s /opt/nvim-*/bin/nvim /usr/local/bin/nvim \
55+
&& chmod u+x /usr/local/bin/nvim
56+
57+
WORKDIR /app
4458

45-
# Installing Lua Dependencies for testing LUA projects
46-
RUN luarocks install busted
59+
# Installing the devcontainers CLI and Lua Dependencies for testing LUA projects
60+
RUN npm install -g @devcontainers/[email protected] \
61+
&& luarocks install busted
4762

4863
ENV USER_NAME=my-app
4964
ARG GROUP_NAME=$USER_NAME

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ make assumptions about how you work.
8080

8181
## Dependencies
8282

83+
- NeoVim 0.9.0+
8384
- [docker](https://docs.docker.com/get-docker/)
8485
- [devcontainer-cli](https://github.com/devcontainers/cli#npm-install)
8586
- [toggleterm](https://github.com/akinsho/toggleterm.nvim)
@@ -148,12 +149,12 @@ make assumptions about how you work.
148149
dotfiles_branch = "devcontainer-cli", -- branch to clone from dotfiles_repository`
149150
dotfiles_targetPath = "~/dotfiles", -- location to install dotfiles
150151
-- script to run after dotfiles are cloned
151-
dotfiles_intallCommand = "install.sh",
152+
dotfiles_intallCommand = "install.sh",
152153
shell = "bash", -- shell to use when executing commands
153154
-- The particular binary to use for connecting to in the devcontainer
154155
-- Most likely this should remain nvim
155156
nvim_binary = "nvim",
156-
-- Set the logging level for console (notifications) and file logging.
157+
-- Set the logging level for console (notifications) and file logging.
157158
-- The available levels are trace, debug, info, warn, error, or fatal.
158159
-- Set the log level for file logging
159160
log_level = "debug",

tests/minimal_init.lua

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
-- Copyright (c) 2024 Erich L Foster
2-
--
2+
--
33
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
44
-- this software and associated documentation files (the "Software"), to deal in
55
-- the Software without restriction, including without limitation the rights to
66
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
77
-- of the Software, and to permit persons to whom the Software is furnished to do
88
-- so, subject to the following conditions:
9-
--
9+
--
1010
-- The above copyright notice and this permission notice shall be included in all
1111
-- copies or substantial portions of the Software.
12-
--
12+
--
1313
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1414
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1515
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
-- SOFTWARE.
20+
vim.opt.runtimepath:prepend(vim.fn.stdpath("data") .. "/site")
21+
vim.opt.packpath = vim.opt.runtimepath:get()
2022

23+
-- Your existing plenary setup
2124
local plenary_dir = os.getenv("PLENARY_DIR") or "/tmp/plenary.nvim"
22-
local is_not_a_directory = vim.fn.isdirectory(plenary_dir) == 0
23-
if is_not_a_directory then
24-
vim.fn.system({ "git", "clone", "https://github.com/nvim-lua/plenary.nvim", plenary_dir })
25+
if vim.fn.isdirectory(plenary_dir) == 0 then
26+
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/nvim-lua/plenary.nvim", plenary_dir })
2527
end
2628

2729
vim.opt.rtp:append(".")

0 commit comments

Comments
 (0)