summaryrefslogtreecommitdiff
path: root/.github/workflows/format.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/format.yaml')
-rw-r--r--.github/workflows/format.yaml43
1 files changed, 43 insertions, 0 deletions
diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml
new file mode 100644
index 00000000..22e56d61
--- /dev/null
+++ b/.github/workflows/format.yaml
@@ -0,0 +1,43 @@
+name: format
+on:
+ push:
+ branches: '**'
+ pull_request:
+ branches:
+ - 'master'
+ - 'rolling'
+
+jobs:
+ stylua-check:
+ name: "Formatting check with Stylua"
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Prepare dependencies
+ run: |
+ sudo apt install -y curl unzip --no-install-recommends
+ bash ./utils/installer/install_stylua.sh
+
+ - name: Check formatting
+ run: |
+ ./utils/stylua --config-path .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 .
+