From dccdc0be6b198b213c0cd2912e8d433a16f21cc4 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 8 Sep 2024 11:38:13 +0100 Subject: [PATCH] ci: add clang-format action To keep the style consistent. Closes: https://github.com/kmod-project/kmod/issues/88 Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/118 Signed-off-by: Lucas De Marchi --- .github/workflows/clang-format.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/clang-format.yml diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 00000000..ba372074 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,18 @@ +name: Check code style with clang-format + +on: + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + stylecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - run: git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }} + - uses: yshui/git-clang-format-lint@a65b466f5903524aef27552f63c3906c0f73f184 # v1.16 + with: + base: ${{ github.event.pull_request.base.sha }}