Skip to content

Commit a845007

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

File tree

4 files changed

+46
-12
lines changed

4 files changed

+46
-12
lines changed

.github/workflows/default.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,37 @@ env:
55
jobs:
66
unit-tests:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
neovim-version: [
11+
# "0.9.0",
12+
# "0.9.1",
13+
# "0.9.2",
14+
# "0.9.4",
15+
"0.9.5",
16+
"0.10.0",
17+
# "0.10.1",
18+
# "0.10.2",
19+
# "0.10.3",
20+
# "0.10.4",
21+
]
22+
fail-fast: false
23+
24+
name: NEOVIM ${{ matrix.neovim-version }}
825
steps:
926
- name: Checkout
1027
uses: actions/checkout@v3
11-
- name: Pre-build devcontainer image
28+
- name: Pre-build devcontainer image for NEOVIM ${{ matrix.neovim-version }}
1229
uses: devcontainers/ci@v0.3
1330
with:
14-
imageName: ${{ env.IMAGE_NAME }}
15-
cacheFrom: ${{ env.IMAGE_NAME }}
31+
imageName: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }}
32+
cacheFrom: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }}
1633
push: never
34+
buildArgs: |
35+
NEOVIM_VERSION=${{ matrix.neovim-version }}
1736
- name: Run tests inside the docker image
1837
uses: devcontainers/ci@v0.3
1938
with:
20-
cacheFrom: ${{ env.IMAGE_NAME }}
39+
cacheFrom: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }}
2140
push: never
2241
runCmd: make test

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21+
ARG NEOVIM_VERSION=0.10.4
22+
2123
FROM ubuntu:22.04 as builder
2224

2325
# Install dependencies needed for building devcontainers/cli and developing in neovim
@@ -37,6 +39,16 @@ RUN apt-get update && \
3739
&& apt-get autoremove -y \
3840
&& rm -rf /var/lib/apt/lists/*
3941

42+
ARG NEOVIM_VERSION
43+
44+
WORKDIR /tmp
45+
46+
# Install NEOVIM
47+
RUN curl -fLO https://github.com/neovim/neovim/releases/download/v${NEOVIM_VERSION}/nvim-linux64.tar.gz
48+
RUN rm -rf /opt/nvim \
49+
&& tar -C /opt -xzf nvim-linux-x86_64.tar.gz \
50+
&& ln -s /opt/nvim/bin/nvim /usr/local/bin/nvim
51+
4052
WORKDIR /app
4153

4254
# Installing the devcontainers CLI

README.md

Lines changed: 3 additions & 2 deletions
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

Lines changed: 8 additions & 6 deletions
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)