Skip to content

Testing overhaul: CMake-driven test helpers & equivalence harnesses #46

Testing overhaul: CMake-driven test helpers & equivalence harnesses

Testing overhaul: CMake-driven test helpers & equivalence harnesses #46

Workflow file for this run

name: Format check
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
# Enforces .clang-format on the C/C++ tree. A PR that introduces any
# formatting drift fails this check with a diff in the run log. To fix
# locally:
#
# clang-format -i path/to/changed/file.{c,h,C,...}
#
# Pinned to clang-format-20 to match the version used for the mass
# reformat. Different clang-format major versions produce subtly
# different output for some constructs (lambdas, switch labels,
# requires-clauses), so version drift between local dev environments
# and CI would cause spurious "passes locally / fails in CI" failures.
jobs:
clang-format:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang-format-20
run: |
wget -q https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
sudo apt-get install -y clang-format-20
clang-format-20 --version
- name: Check formatting
run: |
find src codes doc tests \
-type f \( -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" -o -name "*.cxx" \) \
-exec clang-format-20 --dry-run --Werror {} +