Bläddra i källkod

[Feature] Add shell workflows (#1030)

Luc Sinet 4 år sedan
förälder
incheckning
0b7668d037
2 ändrade filer med 56 tillägg och 0 borttagningar
  1. 18 0
      .github/workflows/format.yaml
  2. 38 0
      .github/workflows/lint.yaml

+ 18 - 0
.github/workflows/format.yaml

@@ -22,4 +22,22 @@ jobs:
       - name: Check formatting
         run: |
           ./utils/stylua --config-path ./utils/.stylua.toml -c .
+  shfmt-check:
+    name: "Formatting check with shfmt"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
 
+      - name: Setup Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: '1.16'
+      
+      - name: Use shfmt
+        run: |
+          GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
+
+      - name: Check formatting
+        run: |
+          shfmt -l -d .
+    

+ 38 - 0
.github/workflows/lint.yaml

@@ -0,0 +1,38 @@
+name: lint
+on:
+  push:
+    branches: '**'
+  pull_request:
+    branches:
+      - 'master'
+      - 'rolling'
+
+jobs:
+  lua-linter:
+    name: "Linting with luacheck"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+      
+      - uses: leafo/gh-actions-lua@v8
+      - uses: leafo/gh-actions-luarocks@v4
+
+      - name: Use luacheck
+        run: luarocks install luacheck
+      
+      - name: Run luacheck
+        run: luacheck *.lua lua/
+    
+  shell-linter:
+    name: "Linting with shellcheck"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+      
+      - name: Use shellcheck
+        run: sudo apt-get install shellcheck
+      
+      - name: Run shellcheck
+        run:  |
+          pwd
+          shellcheck $(find . -name "*.sh")