ci: improve sandboxing of tests
This commit is contained in:
parent
12b808a686
commit
2319ee2397
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
PLUGINS="$HOME/.local/share/nvim/site/pack/plugins/start"
|
||||
mkdir -p "$PLUGINS"
|
||||
|
||||
wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage
|
||||
chmod +x nvim.appimage
|
||||
sudo mv ./nvim.appimage /usr/bin/nvim
|
||||
git clone --depth=1 https://github.com/nvim-lua/plenary.nvim.git "$PLUGINS/plenary.nvim"
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
name: Run tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request: ~
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
luacheck:
|
||||
name: Luacheck
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
|
@ -25,7 +21,7 @@ jobs:
|
|||
|
||||
stylua:
|
||||
name: StyLua
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Stylua
|
||||
|
@ -38,10 +34,10 @@ jobs:
|
|||
run_tests:
|
||||
strategy:
|
||||
matrix:
|
||||
nvim_tag: [v0.7.0, v0.7.2]
|
||||
nvim_tag: [v0.7.0, v0.7.2, v0.8.0]
|
||||
|
||||
name: Run tests
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
NVIM_TAG: ${{ matrix.nvim_tag }}
|
||||
steps:
|
||||
|
|
|
@ -39,3 +39,4 @@ luac.out
|
|||
*.x86_64
|
||||
*.hex
|
||||
|
||||
.testenv/
|
||||
|
|
21
run_tests.sh
21
run_tests.sh
|
@ -1,5 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
nvim --headless --noplugin -u tests/init.lua \
|
||||
-c "PlenaryBustedDirectory ${1-tests} { minimal_init = './tests/init.lua' }"
|
||||
mkdir -p ".testenv/config/nvim"
|
||||
mkdir -p ".testenv/data/nvim"
|
||||
mkdir -p ".testenv/state/nvim"
|
||||
mkdir -p ".testenv/run/nvim"
|
||||
mkdir -p ".testenv/cache/nvim"
|
||||
PLUGINS=".testenv/data/nvim/site/pack/plugins/start"
|
||||
|
||||
if [ ! -e "$PLUGINS/plenary.nvim" ]; then
|
||||
git clone --depth=1 https://github.com/nvim-lua/plenary.nvim.git "$PLUGINS/plenary.nvim"
|
||||
fi
|
||||
|
||||
XDG_CONFIG_HOME=".testenv/config" \
|
||||
XDG_DATA_HOME=".testenv/data" \
|
||||
XDG_STATE_HOME=".testenv/state" \
|
||||
XDG_RUNTIME_DIR=".testenv/run" \
|
||||
XDG_CACHE_HOME=".testenv/cache" \
|
||||
nvim --headless -u tests/minimal_init.lua \
|
||||
-c "PlenaryBustedDirectory ${1-tests} { minimal_init = './tests/minimal_init.lua' }"
|
||||
echo "Success"
|
||||
|
|
Loading…
Reference in New Issue