From 54a9137622b53b80a333681d2db43202849cba6b Mon Sep 17 00:00:00 2001 From: Nick Mazuk Date: Sun, 27 Mar 2022 12:16:46 -0700 Subject: [PATCH] add code format checker to CI --- .github/workflows/format.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..b0b0f024 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,24 @@ +name: Check code format + +on: ['push'] + +jobs: + check-format: + runs-on: ubuntu-latest + steps: + - name: Checkout this repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: Ana06/get-changed-files@v2.1.0 + with: + filter: '*.lua' + + - uses: leafo/gh-actions-lua@v9 + - uses: leafo/gh-actions-luarocks@v4 + - name: Install LuaFormat + run: | + luarocks install --server=https://luarocks.org/dev luaformatter + - name: Check formatting + run: | + ./lua-format {{ steps.files.outputs.added_modified }} -c ./luaconfig.config --check