From c5dde8a42c115b6d47ffa43dbdf1e74cb41e733a Mon Sep 17 00:00:00 2001 From: Ping Xie Date: Thu, 23 May 2024 18:17:06 -0700 Subject: [PATCH] Set up clang-format github action Signed-off-by: Ping Xie --- src/.clang-format => .clang-format | 0 .github/workflows/ci.yml | 17 +++++++++++++++++ src/.clang-format-ignore | 1 + 3 files changed, 18 insertions(+) rename src/.clang-format => .clang-format (100%) diff --git a/src/.clang-format b/.clang-format similarity index 100% rename from src/.clang-format rename to .clang-format diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b64798a6f9..38bc096a51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,23 @@ permissions: jobs: + checkers: + name: Run static checkers + runs-on: ubuntu-latest + strategy: + matrix: + path: + - check: 'src' + exclude: 'src/(lzf.*|crccombine.*|crc16.c|crc16_slottable.h|crc64.c|crcspeed.*|fmtargs.h|mt19937-64.*|pqsort.*|setcpuaffinity.c|setproctitle.c|sha1.*|sha256.*|siphash.c|strl.c|unit/test_files.h)' + steps: + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + - name: Run clang-format style check (.c and .h) + uses: jidicula/clang-format-action@f62da5e3d3a2d88ff364771d9d938773a618ab5e # v4.11.0 + with: + clang-format-version: '13' + check-path: ${{ matrix.path['check'] }} + exclude-regex: ${{ matrix.path['exclude'] }} + test-ubuntu-latest: runs-on: ubuntu-latest steps: diff --git a/src/.clang-format-ignore b/src/.clang-format-ignore index b5519ddfc4..894187c2fe 100644 --- a/src/.clang-format-ignore +++ b/src/.clang-format-ignore @@ -14,3 +14,4 @@ sha1.* sha256.* siphash.c strl.c +unit/test_files.h