-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.59 KB
/
Copy pathdarklua.yml
File metadata and controls
56 lines (51 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Darklua
on:
# push:
# paths:
# - 'modules/**/*.module.luau'
# - '.darklua.json5'
# - 'scripts/polyfill.js'
# - 'scripts/compatibility.js'
# - 'scripts/compat/**'
# - '.github/workflows/darklua.yml'
pull_request:
paths:
- 'modules/**/*.module.luau'
- '.darklua.json5'
- 'scripts/polyfill.js'
- 'scripts/compatibility.js'
- 'scripts/compat/**'
- '.github/workflows/darklua.yml'
jobs:
darklua:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Darklua
run: |
wget -q https://github.com/seaofvoices/darklua/releases/download/v0.19.0/darklua-linux-x86_64.zip
unzip -q darklua-linux-x86_64.zip
chmod +x darklua
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Lua 5.1
uses: leafo/gh-actions-lua@v12
with:
luaVersion: "5.1.5"
- name: Transpile all Luau modules
shell: bash
run: |
set -euo pipefail
out_dir="$(mktemp -d)"
while IFS= read -r -d '' path; do
rel="${path#modules/}"
out_path="${out_dir}/${rel%.module.luau}.module.lua"
mkdir -p "$(dirname "$out_path")"
./darklua process --config .darklua.json5 "$path" "$out_path"
node scripts/polyfill.js "$out_path"
node scripts/compatibility.js "$out_path"
luac -p "$out_path"
done < <(find modules -type f -name '*.module.luau' -print0)