-
Notifications
You must be signed in to change notification settings - Fork 11
92 lines (80 loc) · 2.47 KB
/
ci.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on: [push, pull_request]
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout Lilia Repository
uses: actions/checkout@v3
with:
path: lilia
- name: Set Up Lua
uses: leafo/gh-actions-lua@v8.0.0
with:
luaVersion: "5.2"
- name: Set Up Luarocks
uses: leafo/gh-actions-luarocks@v4.0.0
- name: Pull GluaCheck
uses: actions/checkout@v3
with:
repository: LiliaFramework/GluaCheck
path: luacheck
- name: Build GluaCheck
working-directory: luacheck
run: luarocks make
- name: Run Luacheck Linting
working-directory: lilia
run: |
luacheck . \
--no-redefined \
--no-global --no-self \
--no-max-line-length --no-max-code-line-length \
--no-max-string-line-length --no-max-comment-line-length \
--no-max-cyclomatic-complexity
formatter:
runs-on: ubuntu-latest
needs: linter
steps:
- name: Checkout Lilia Repository
uses: actions/checkout@v3
with:
path: lilia
- name: Download and Install GLuaLint
run: |
curl -L -o glualint.zip https://github.com/FPtje/GLuaFixer/releases/download/1.29.0/glualint-1.29.0-x86_64-linux.zip
unzip glualint.zip -d glualint_folder
chmod +x glualint_folder/glualint
sudo mv glualint_folder/glualint /usr/local/bin
rm -rf glualint.zip glualint_folder
- name: Run GLuaLint for Pretty Printing
working-directory: lilia
run: glualint --pretty-print .
- name: Configure Git
run: |
git config --global user.email "githubactions@github.com"
git config --global user.name "GitHub Actions"
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.LiliaGitSecret }}
working-directory: lilia
run: |
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Pretty Printed"
git push https://${{ secrets.LiliaGitSecret }}@github.com/${{ github.repository }}.git main
else
echo "No changes to commit"