aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/luacheck.yml17
-rw-r--r--.github/workflows/pre-commit.yml31
2 files changed, 31 insertions, 17 deletions
diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml
deleted file mode 100644
index 1d24ecc..0000000
--- a/.github/workflows/luacheck.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: luacheck
-
-on: [pull_request, push]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v1
- - name: apt
- run: sudo apt-get install -y luarocks
- - name: luacheck install
- run: luarocks install --local luacheck
- - name: luacheck run
- run: $HOME/.luarocks/bin/luacheck ./
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
new file mode 100644
index 0000000..37221d7
--- /dev/null
+++ b/.github/workflows/pre-commit.yml
@@ -0,0 +1,31 @@
+name: pre-commit
+on: [push, pull_request, workflow_dispatch]
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@master
+ - uses: actions/setup-python@master
+
+ - name: install luarocks
+ run: sudo apt-get install -y luarocks
+
+ - name: add luarocks path
+ run: echo "$HOME/.luarocks/bin" >> $GITHUB_PATH
+
+ - name: luacheck install
+ run: luarocks install --local luacheck
+
+ - name: install cargo
+ run: sudo apt-get install -y cargo
+
+ - name: install stylua
+ run: cargo install stylua
+
+ - name: Install pre-commit
+ run: pip3 install pre-commit
+
+ - name: Run pre-commit
+ run: pre-commit run --all-files