From cc746b8fd240aae3e0a9ead62250b08ec2e6d66f Mon Sep 17 00:00:00 2001 From: iGxnon Date: Sat, 13 Jan 2024 00:11:43 +0800 Subject: [PATCH] ci: add format check ci Signed-off-by: iGxnon --- .github/workflows/pr.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..135eca6 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,22 @@ +name: PR Checks + +on: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: {} + +env: + STYLE: "{ IndentWidth: 4, BasedOnStyle: google, AlignConsecutiveAssignments: true }" + +jobs: + format: + name: Format Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install clang-format + run: sudo apt-get update -y --force-yes && sudo apt-get install -y --force-yes clang-format + + - name: Check format + run: "clang-format --dry-run -Werror --style='${{ env.STYLE }}' src/*"