From 9d8e2a1748d866864b07800e4c1494136cc2521d Mon Sep 17 00:00:00 2001 From: dreampearl Date: Sun, 17 Oct 2021 22:18:49 +0530 Subject: [PATCH] Add github action for code style linter --- .github/workflows/code-style.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/code-style.yml diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 0000000..2319262 --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,23 @@ +name: Code Style CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install clang-format + run: | + sudo apt-get update + sudo apt install clang-format + - name: C/CPP code style check + run: | + find . -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp -o -iname *.tcc | \ + xargs clang-format --style="{BasedOnStyle: llvm, IndentWidth: 4}" --dry-run --Werror