Skip to content

Commit 6a7233d

Browse files
committed
add github workflow
1 parent b763956 commit 6a7233d

18 files changed

Lines changed: 42 additions & 11 deletions

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
name: Lint and Typecheck
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Cache cargo
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.cargo
20+
key: cargo-stylua-${{ runner.os }}
21+
22+
- name: Install tools
23+
run: make install-tools
24+
25+
- name: Run checks
26+
run: make check

.luarc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"io": "disable",
1010
"bit32": "disable"
1111
},
12-
"workspace.library": ["types"],
13-
"workspace.ignoreDir": ["bin", "types"],
12+
"workspace.library": ["edgetx-lua-stdlib"],
13+
"workspace.ignoreDir": ["bin", "edgetx-lua-stdlib"],
1414
"workspace.checkThirdParty": false,
1515
"diagnostics.disable": ["lowercase-global"]
1616
}

Makefile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,29 @@ LUALS_DIR := bin/lua-language-server
88
LUALS := $(LUALS_DIR)/bin/lua-language-server
99
LUALS_URL := https://github.com/LuaLS/lua-language-server/releases/download/$(LUALS_VERSION)/lua-language-server-$(LUALS_VERSION)-linux-x64.tar.gz
1010

11-
.PHONY: help install-tools format format-check typecheck check
11+
.PHONY: help install-tools install-stylua install-luals format format-check typecheck check
1212

1313
help:
1414
@echo "Usage: make <target>"
1515
@echo ""
16-
@echo " install-tools Install stylua (via cargo) and lua-language-server"
17-
@echo " format Format Lua files with stylua"
18-
@echo " format-check Check formatting without modifying files"
19-
@echo " typecheck Run lua-language-server type checking"
20-
@echo " check Run format-check and typecheck"
21-
22-
install-tools:
23-
ec
16+
@echo " install-tools Install stylua and lua-language-server"
17+
@echo " install-stylua Install stylua (via cargo)"
18+
@echo " install-luals Install lua-language-server"
19+
@echo " format Format Lua files with stylua"
20+
@echo " format-check Check formatting without modifying files"
21+
@echo " typecheck Run lua-language-server type checking"
22+
@echo " check Run format-check and typecheck"
23+
24+
install-stylua:
2425
@command -v cargo >/dev/null 2>&1 || { echo "cargo is required (install Rust: https://rustup.rs)"; exit 1; }
2526
cargo install stylua --features lua53
27+
28+
install-luals:
2629
mkdir -p $(LUALS_DIR)
2730
curl -fSL $(LUALS_URL) | tar xz -C $(LUALS_DIR)
2831

32+
install-tools: install-stylua install-luals
33+
2934
format:
3035
stylua $(LUA_DIRS)
3136

0 commit comments

Comments
 (0)