-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b48e3f
commit 609c53f
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Lint and Indent Code | ||
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: | ||
glualint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: skeleton | ||
- name: Setup Lua | ||
uses: leafo/[email protected] | ||
with: | ||
luaVersion: '5.2' | ||
- name: Setup LuaRocks | ||
uses: leafo/[email protected] | ||
- name: Pull gluacheck | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: impulsh/gluacheck | ||
path: luacheck | ||
- name: Build gluacheck | ||
working-directory: luacheck | ||
run: luarocks make | ||
- name: Lint with gluacheck | ||
working-directory: skeleton | ||
run: >- | ||
luacheck . --no-unused-secondaries --no-unused-args --no-redefined | ||
--no-unused --no-global --no-self -i 4.2/.*_ --formatter visual_studio | ||
--no-unused --no-max-line-length --no-max-code-line-length | ||
--no-max-string-line-length --no-max-comment-line-length | ||
--no-max-cyclomatic-complexity | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Bash | ||
run: | | ||
sudo apt update | ||
sudo apt install -y unzip | ||
shell: bash | ||
- name: List files in the working directory (Before running GLuaFixer) | ||
run: | | ||
ls | ||
- name: Set location of Skeleton Schema | ||
run: | | ||
cd skeleton | ||
- name: List files in skeleton | ||
run: | | ||
ls | ||
working-directory: '${{ github.workspace }}/skeleton' | ||
- name: Download GLuaFixer (Step 1) | ||
run: | | ||
echo "Step 1: Downloading glualint..." | ||
curl -L -o glualint.zip https://github.com/FPtje/GLuaFixer/releases/download/1.26.0/glualint-1.26.0-x86_64-linux.zip | ||
unzip glualint.zip -d glualint | ||
mv glualint/glualint glualint_executable | ||
working-directory: '${{ github.workspace }}' | ||
shell: bash | ||
- name: Set execution permissions (Step 2) | ||
run: | | ||
echo "Step 2: Setting execution permissions..." | ||
sudo chmod +x glualint_executable | ||
working-directory: '${{ github.workspace }}' | ||
shell: bash | ||
- name: List files in the working directory (After downloading GLuaFixer) | ||
run: | | ||
ls | ||
- name: Run GLuaFixer on Skeleton Schema (Step 7) | ||
run: | | ||
echo "Step 7: Running glualint pretty-print on Skeleton Schema" | ||
sudo ./glualint_executable pretty-print skeleton/* | ||
working-directory: '${{ github.workspace }}' | ||
shell: bash | ||
- name: Remove the glualint folder (Step 8) | ||
run: | | ||
echo "Step 8: Removing the glualint folder..." | ||
rm -r glualint | ||
working-directory: '${{ github.workspace }}' | ||
shell: bash | ||
- name: Delete the zip file (Step 9) | ||
run: | | ||
echo "Step 9: Deleting glualint.zip..." | ||
rm glualint.zip | ||
working-directory: '${{ github.workspace }}' | ||
- name: Delete the glualint_executable (Step 10) | ||
run: | | ||
echo "Step 10: Deleting glualint_executable..." | ||
rm glualint_executable | ||
working-directory: '${{ github.workspace }}' | ||
shell: bash | ||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
if [[ -n "$(git status --porcelain)" ]]; then | ||
git add -A | ||
git commit -m "Auto-commit after running GLuaFixer" | ||
git push | ||
else | ||
echo "No changes to commit." | ||
fi | ||
working-directory: '${{ github.workspace }}' |
Empty file.