Skip to content

Commit 48f4f96

Browse files
committed
Update ci.yml
1 parent 79f2a2b commit 48f4f96

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,76 @@ permissions:
2020
statuses: write
2121

2222
jobs:
23+
strip-comments:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
- run: |
28+
curl -sSfL https://raw.githubusercontent.com/bleonheart/Useful-Python-Scripts/refs/heads/main/files/remove_lua_comments.py -o remove_lua_comments.py || curl -sSfL https://raw.githubusercontent.com/bleonheart/Useful-Python-Scripts/main/files/remove_lua_comments.py -o remove_lua_comments.py
29+
python3 remove_lua_comments.py modules
30+
tar --exclude=.git -cf workspace.tar .
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: workspace
34+
path: workspace.tar
35+
overwrite: true
36+
retention-days: 1
37+
38+
format-glua:
39+
needs: strip-comments
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: actions/download-artifact@v4
44+
with:
45+
name: workspace
46+
path: .
47+
- run: |
48+
tar -xf workspace.tar
49+
rm -f workspace.tar
50+
- name: Download glualint binary
51+
env:
52+
GLUALINT_VERSION: "1.29.0"
53+
run: |
54+
set -euo pipefail
55+
sudo apt-get update -y
56+
sudo apt-get install -y unzip file
57+
arch="$(uname -m)"
58+
case "$arch" in
59+
x86_64) asset="glualint-${GLUALINT_VERSION}-x86_64-linux.zip" ;;
60+
aarch64|arm64) asset="glualint-${GLUALINT_VERSION}-aarch64-linux.zip" ;;
61+
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;;
62+
esac
63+
url="https://github.com/FPtje/GLuaFixer/releases/download/${GLUALINT_VERSION}/${asset}"
64+
curl -fLsS "$url" -o glualint.zip
65+
unzip -o glualint.zip
66+
chmod +x glualint
67+
./glualint --version
68+
- name: Pretty-print all Lua files
69+
run: |
70+
find . -type f -name "*.lua" -print0 | xargs -0 ./glualint --pretty-print-files
71+
tar --exclude=.git -cf workspace.tar .
72+
- uses: actions/upload-artifact@v4
73+
with:
74+
name: workspace
75+
path: workspace.tar
76+
overwrite: true
77+
retention-days: 1
78+
2379
linter:
80+
needs: format-glua
2481
runs-on: ubuntu-latest
2582
steps:
2683
- uses: actions/checkout@v3
2784
with:
2885
path: modules
86+
- uses: actions/download-artifact@v4
87+
with:
88+
name: workspace
89+
path: .
90+
- run: |
91+
tar -xf workspace.tar
92+
rm -f workspace.tar
2993
- uses: leafo/gh-actions-lua@v8.0.0
3094
with:
3195
luaVersion: 5.2
@@ -298,4 +362,4 @@ jobs:
298362
else
299363
git commit -m "Updated Some Public Modules"
300364
git push https://x-access-token:${{ secrets.LiliaGitSecret }}@github.com/LiliaFramework/Lilia.git HEAD:main
301-
fi
365+
fi

0 commit comments

Comments
 (0)