build: use local version of tl and inspect

This commit is contained in:
Lewis Russell 2022-08-19 11:40:54 +01:00 committed by Lewis Russell
parent 16e5ecc5f5
commit 6eb07412c2
3 changed files with 48 additions and 42 deletions

View File

@ -32,9 +32,7 @@ jobs:
env:
NEOVIM_BRANCH: ${{ matrix.neovim_branch }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup build dependencies
@ -47,45 +45,38 @@ jobs:
g++ \
gettext \
gperf \
libjemalloc-dev \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libtool \
libtool-bin \
libunibilium-dev \
libvterm-dev \
lua-bitop \
lua-lpeg \
lua-mpack \
ninja-build \
pkg-config \
unzip
- uses: leafo/gh-actions-lua@v8
- name: Install LuaJIT
uses: leafo/gh-actions-lua@v9
with:
luaVersion: "luajit-2.1.0-beta3"
- uses: leafo/gh-actions-luarocks@v4
- name: Install teal
run: luarocks install tl 0.13.2
- name: Install Luarocks
uses: leafo/gh-actions-luarocks@v4
- name: Cache Deps
id: cache-deps
uses: actions/cache@v2
run: |
echo "::set-output name=sha::$(git ls-remote https://github.com/neovim/neovim ${{env.NEOVIM_BRANCH}} | cut -f1)"
with:
path: deps
key: build-6-${{ steps.cache-deps.outputs.sha }}
- name: Install Lua Deps
run: make lua_deps
- name: Check lua files are built from latest teal
run: make tl-ensure
- name: Get Neovim SHA
id: get-nvim-sha
run: |
echo "::set-output name=sha::$(git ls-remote https://github.com/neovim/neovim ${{env.NEOVIM_BRANCH}} | cut -f1)"
shell: bash
- name: Cache neovim
uses: actions/cache@v2
with:
path: deps/neovim
key: build-${{ steps.get-nvim-sha.outputs.sha }}
- name: Build Neovim
if: steps.cache-deps.outputs.cache-hit != 'true'
run: make deps/neovim NEOVIM_BRANCH=$NEOVIM_BRANCH
- name: Run Test

View File

@ -1,12 +1,7 @@
## Requirements
- [Neovim](https://github.com/neovim/neovim)
- [Luarocks](https://luarocks.org/)
- `brew install luarocks`
- [Teal](https://github.com/teal-language/tl)
- `luarocks --lua-version=5.1 install tl`
- [Inspect](https://github.com/kikito/inspect.lua)
- `luarocks --lua-version=5.1 install inspect`
## Writing Teal

View File

@ -3,23 +3,43 @@ export PJ_ROOT=$(PWD)
FILTER ?= .*
INIT_LUAROCKS := eval $$(luarocks --lua-version=5.1 path) &&
LUA_VERSION := 5.1
TL_VERSION := 0.13.2
NEOVIM_BRANCH := master
LUAROCKS := luarocks --lua-version=$(LUA_VERSION)
LUAROCKS_TREE := $(PWD)/deps/luarocks/usr
LUAROCKS_LPATH := $(LUAROCKS_TREE)/share/lua/$(LUA_VERSION)
LUAROCKS_INIT := eval $$($(LUAROCKS) --tree $(LUAROCKS_TREE) path) &&
.DEFAULT_GOAL := build
NEOVIM_BRANCH := master
deps/neovim:
@mkdir -p deps
git clone --depth 1 https://github.com/neovim/neovim --branch $(NEOVIM_BRANCH) $@
make -C $@
make -C $@ DEPS_BUILD_DIR=$(dir $(LUAROCKS_TREE))
TL := $(LUAROCKS_TREE)/bin/tl
$(TL):
@mkdir -p $@
$(LUAROCKS) --tree $(LUAROCKS_TREE) install tl $(TL_VERSION)
INSPECT := $(LUAROCKS_LPATH)/inspect.lua
$(INSPECT):
@mkdir -p $@
$(LUAROCKS) --tree $(LUAROCKS_TREE) install inspect
.PHONY: lua_deps
lua_deps: $(TL) $(INSPECT)
export VIMRUNTIME=$(PWD)/deps/neovim/runtime
export TEST_COLORS=1
.PHONY: test
test: deps/neovim
$(INIT_LUAROCKS) deps/neovim/.deps/usr/bin/busted \
$(LUAROCKS_INIT) busted \
-v \
--lazy \
--helper=$(PWD)/test/preload.lua \
@ -35,17 +55,17 @@ test: deps/neovim
-@stty sane
.PHONY: tl-check
tl-check:
$(INIT_LUAROCKS) tl check teal/*.tl teal/**/*.tl
tl-check: $(TL)
$(TL) check teal/*.tl teal/**/*.tl
.PHONY: tl-build
tl-build: tlconfig.lua
@$(INIT_LUAROCKS) tl build
tl-build: tlconfig.lua $(TL)
@$(TL) build
@echo Updated lua files
.PHONY: gen_help
gen_help:
@$(INIT_LUAROCKS) ./gen_help.lua
gen_help: $(INSPECT)
@$(LUAROCKS_INIT) ./gen_help.lua
@echo Updated help
.PHONY: build