Skip to content

Commit

Permalink
Make installable via LuaRocks (#35)
Browse files Browse the repository at this point in the history
* switched ltreesitter to ltreesitter-ts (bundles in the tree-sitter lib)

* updated LuaRocks version in CI

* run unit tests in CI

* updated rockspec to support the new version
  • Loading branch information
FourierTransformer authored Dec 1, 2024
1 parent 85d6a63 commit f1f9117
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ jobs:

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v4
with:
luarocksVersion: "3.10.0"

- name: Build
run: scripts/setup_local_luarocks.sh

- name: Run Tests
run: scripts/run_tests.sh

- name: Lint
run: scripts/lint_teal.sh

Expand Down
12 changes: 12 additions & 0 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

# Navigate to the root of the repo
cd "$(dirname "$0")/.."

# Set the local LuaRocks path
LUAROCKS_TREE="$(pwd)/luarocks_tree"

# Run unit tests
echo "Run LuaRocks tests:"
luarocks test --tree="$LUAROCKS_TREE"
7 changes: 5 additions & 2 deletions scripts/setup_local_luarocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ set -e
# Navigate to the root of the repo
cd "$(dirname "$0")/.."

luarocks init --tree=./luarocks_tree

# Set the local LuaRocks path
LUAROCKS_TREE="$(pwd)/luarocks_tree"

# setup local LuaRocks
luarocks init --tree="$LUAROCKS_TREE"
PATH="$LUAROCKS_TREE/bin":"$PATH"
export PATH

# Install project dependencies from the rockspec
echo "Installing project dependencies..."
luarocks make --tree="$LUAROCKS_TREE"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rockspec_format = "3.0"

package = "teal-language-server"
version = "0.0.5-1"
version = "0.1.0-1"

source = {
url = "git+https://github.com/teal-language/teal-language-server.git",
Expand All @@ -23,8 +23,8 @@ dependencies = {
"inspect",
"luv",
"lusc_luv >= 4.0",
"ltreesitter",
"tree-sitter-cli",
"ltreesitter-ts==0.0.1",
"tree-sitter-cli==0.24.4",
"tree-sitter-teal",
}

Expand All @@ -47,6 +47,7 @@ build = {
["teal_language_server.env_updater"] = "gen/teal_language_server/env_updater.lua",
["teal_language_server.lsp"] = "gen/teal_language_server/lsp.lua",
["teal_language_server.lsp_events_manager"] = "gen/teal_language_server/lsp_events_manager.lua",
["teal_language_server.lsp_formatter"] = "gen/teal_language_server/lsp_formatter.lua",
["teal_language_server.lsp_reader_writer"] = "gen/teal_language_server/lsp_reader_writer.lua",
["teal_language_server.main"] = "gen/teal_language_server/main.lua",
["teal_language_server.misc_handlers"] = "gen/teal_language_server/misc_handlers.lua",
Expand Down

0 comments on commit f1f9117

Please sign in to comment.