Skip to content

Commit

Permalink
try custom image for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gorillamoe committed Sep 7, 2024
1 parent 6458b8c commit 1effcdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,21 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
rev: v0.10.0/nvim.appimage
- os: ubuntu-latest
container-image: ghcr.io/mistweaverco/kulala-nvim-testrunner:latest
container:
image: ${{ matrix.container-image }}
steps:
- uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
with:
path: |
_neovim
~/.local/share/nvim/site/pack/vendor/start
key: ${{ runner.os }}-${{ matrix.rev }}
key: ${{ runner.os }}-${{ matrix.container-image }}

- name: Prepare dependencies
run: | # TODO: Cache apt dependencies
sudo apt-get update && sudo apt-get install -y libfuse2
./scripts/tests.sh prepare ${{ matrix.rev }}
run: ./scripts/tests.sh prepare

- name: Run tests
run: ./scripts/tests.sh run
11 changes: 1 addition & 10 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@
# Copy from MIT licensed neotest plugin:
# https://github.com/nvim-neotest/neotest/blob/958a6bff41c7086fe8b46f7f320d0fd073cfc6a0/scripts/test

NVIM_DL_BASE="https://github.com/neovim/neovim/releases/download/"

prepare() {
local version=$1

if [[ ! -f _neovim/nvim ]] && [[ -n $version ]]; then
mkdir -p _neovim && curl -sL -o _neovim/nvim "${NVIM_DL_BASE}${version}" && chmod +x _neovim/nvim
_neovim/nvim --headless -c 'TSInstallSync lua | quit'
fi
nvim --headless -c 'TSInstallSync lua | quit'
if [[ ! -d ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim ]]; then
git clone --depth 1 \
https://github.com/nvim-lua/plenary.nvim \
Expand All @@ -23,8 +16,6 @@ prepare() {
}

run() {
type _neovim/nvim && nvim() { _neovim/nvim "$@"; }

local tempfile
tempfile=$(mktemp)

Expand Down
5 changes: 5 additions & 0 deletions tests/_dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ubuntu:latest

RUN apt-get update && apt-get upgrade -y && apt-get install -y curl git
RUN mkdir -p _neovim && curl -sL https://github.com/neovim/neovim/releases/download/v0.10.1/nvim-linux64.tar.gz | tar -xz -C _neovim && mv _neovim/nvim-linux64 /usr/local/nvim && rm -rf _neovim
RUN ln -s /usr/local/nvim/bin/nvim /usr/bin/nvim

0 comments on commit 1effcdf

Please sign in to comment.