From 3a736777fd168a15e1eb89363818205fa72a6a77 Mon Sep 17 00:00:00 2001 From: orng Date: Sat, 28 Mar 2026 22:50:45 -0500 Subject: [PATCH] ci: simplify `clang-format` --- .github/workflows/clang-format.yml | 72 ++++++------------------------ 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 4965d4b15..ed5f9a402 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,69 +1,23 @@ -name: Clang Format +name: Clang-Format (Linux x86/64) on: push: - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - '.clang-format' - - '.github/workflows/clang-format.yml' - - '.github/scripts/check-clang-format.sh' - pull_request: - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - '.clang-format' - - '.github/workflows/clang-format.yml' - - '.github/scripts/check-clang-format.sh' + - "**.cpp" + - "**.h" + - "**.meson.build" + - ".github/workflows/*" jobs: - clang-format: - runs-on: ubuntu-24.04 - concurrency: - group: clang-format-${{ github.ref }} - cancel-in-progress: true + formatting-check: + runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install clang-format - run: | - sudo apt-get update - sudo apt-get install -y clang-format-19 - - - name: Check changed files - env: - CLANG_FORMAT_BIN: clang-format-19 - EVENT_NAME: ${{ github.event_name }} - PR_BASE_REF: ${{ github.event.pull_request.base.ref }} - PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} - BEFORE_SHA: ${{ github.event.before }} - CURRENT_SHA: ${{ github.sha }} - run: | - set -euo pipefail - - BASE_SHA="" - if [ "$EVENT_NAME" = "pull_request" ]; then - git fetch --no-tags origin "$PR_BASE_REF" - BASE_SHA="$(git merge-base "origin/$PR_BASE_REF" "$CURRENT_SHA")" - elif [ -n "$BEFORE_SHA" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then - BASE_SHA="$BEFORE_SHA" - fi - - bash ./.github/scripts/check-clang-format.sh "$BASE_SHA" "$CURRENT_SHA" + - name: Run clang-format style check + uses: jidicula/clang-format-action@v4.18.0 + with: + # keep this in line with the flake + clang-format-version: "21"